func WebsocketServer() *WebsocketServerBuilder {
	return &WebsocketServerBuilder{
		addr: fmt.Sprintf(":%d", DefaultPort),
		path: "/",
	}
}
WebsocketServer creates a new WebsocketServerBuilder.
package rsocket
import (
	"context"
	"crypto/tls"
	"fmt"
	"net/http"
	"net/url"
	"os"
	"github.com/gorilla/websocket"
	"github.com/rsocket/rsocket-go/core/transport"
)
const (
	DefaultUnixSockPath = "/var/run/rsocket.sock"
	DefaultPort = 7878
)
type TCPClientBuilder struct {
	addr   string
	tlsCfg *tls.Config
}
type TCPServerBuilder struct {
	addr   string
	tlsCfg *tls.Config
}
type WebsocketClientBuilder struct {
	url    string
	tlsCfg *tls.Config
	header http.Header
	proxy  func(*http.Request) (*url.URL, error)
}
type WebsocketServerBuilder struct {
	addr      string
	path      string
	tlsConfig *tls.Config
	upgrader  *websocket.Upgrader
}
type UnixClientBuilder struct {
	path string
}
type UnixServerBuilder struct {
	path string
}
func (us *UnixServerBuilder) SetPath(path string) *UnixServerBuilder {
	us.path = path
	return us
}
func (us *UnixServerBuilder) Build() transport.ServerTransporter {
	return func(ctx context.Context) (transport.ServerTransport, error) {
		if _, err := os.Stat(us.path); !os.IsNotExist(err) {
			return nil, err
		}
		return transport.NewTCPServerTransportWithAddr("unix", us.path, nil), nil
	}
}
func (uc *UnixClientBuilder) SetPath(path string) *UnixClientBuilder {
	uc.path = path
	return uc
}
func (uc UnixClientBuilder) Build() transport.ClientTransporter {
	return func(ctx context.Context) (*transport.Transport, error) {
		return transport.NewTCPClientTransportWithAddr(ctx, "unix", uc.path, nil)
	}
}
func (ws *WebsocketServerBuilder) SetAddr(addr string) *WebsocketServerBuilder {
	ws.addr = addr
	return ws
}
func (ws *WebsocketServerBuilder) SetPath(path string) *WebsocketServerBuilder {
	ws.path = path
	return ws
}
func (ws *WebsocketServerBuilder) SetTLSConfig(c *tls.Config) *WebsocketServerBuilder {
	ws.tlsConfig = c
	return ws
}
func (ws *WebsocketServerBuilder) SetUpgrader(upgrader *websocket.Upgrader) *WebsocketServerBuilder {
	ws.upgrader = upgrader
	return ws
}
func (ws *WebsocketServerBuilder) Build() transport.ServerTransporter {
	return func(ctx context.Context) (transport.ServerTransport, error) {
		return transport.NewWebsocketServerTransportWithAddr(ws.addr, ws.path, ws.upgrader, ws.tlsConfig), nil
	}
}
func (wc *WebsocketClientBuilder) SetTLSConfig(c *tls.Config) *WebsocketClientBuilder {
	wc.tlsCfg = c
	return wc
}
func (wc *WebsocketClientBuilder) SetURL(url string) *WebsocketClientBuilder {
	wc.url = url
	return wc
}
func (wc *WebsocketClientBuilder) SetHeader(header http.Header) *WebsocketClientBuilder {
	wc.header = header
	return wc
}
func (wc *WebsocketClientBuilder) SetProxy(proxy func(*http.Request) (*url.URL, error)) *WebsocketClientBuilder {
	wc.proxy = proxy
	return wc
}
func (wc *WebsocketClientBuilder) Build() transport.ClientTransporter {
	return func(ctx context.Context) (*transport.Transport, error) {
		return transport.NewWebsocketClientTransport(ctx, wc.url, wc.tlsCfg, wc.header, wc.proxy)
	}
}
func (ts *TCPServerBuilder) SetHostAndPort(host string, port int) *TCPServerBuilder {
	ts.addr = fmt.Sprintf("%s:%d", host, port)
	return ts
}
func (ts *TCPServerBuilder) SetAddr(addr string) *TCPServerBuilder {
	ts.addr = addr
	return ts
}
func (ts *TCPServerBuilder) SetTLSConfig(c *tls.Config) *TCPServerBuilder {
	ts.tlsCfg = c
	return ts
}
func (ts *TCPServerBuilder) Build() transport.ServerTransporter {
	return func(ctx context.Context) (transport.ServerTransport, error) {
		return transport.NewTCPServerTransportWithAddr("tcp", ts.addr, ts.tlsCfg), nil
	}
}
func (tc *TCPClientBuilder) SetHostAndPort(host string, port int) *TCPClientBuilder {
	tc.addr = fmt.Sprintf("%s:%d", host, port)
	return tc
}
func (tc *TCPClientBuilder) SetAddr(addr string) *TCPClientBuilder {
	tc.addr = addr
	return tc
}
func (tc *TCPClientBuilder) SetTLSConfig(c *tls.Config) *TCPClientBuilder {
	tc.tlsCfg = c
	return tc
}
func (tc *TCPClientBuilder) Build() transport.ClientTransporter {
	return func(ctx context.Context) (*transport.Transport, error) {
		return transport.NewTCPClientTransportWithAddr(ctx, "tcp", tc.addr, tc.tlsCfg)
	}
}
func TCPClient() *TCPClientBuilder {
	return &TCPClientBuilder{
		addr: fmt.Sprintf(":%d", DefaultPort),
	}
}
func TCPServer() *TCPServerBuilder {
	return &TCPServerBuilder{
		addr: fmt.Sprintf(":%d", DefaultPort),
	}
}
func WebsocketClient() *WebsocketClientBuilder {
	return &WebsocketClientBuilder{
		url:   fmt.Sprintf("ws://127.0.0.1:%d", DefaultPort),
		proxy: http.ProxyFromEnvironment,
	}
}