Versions in this module Expand all Collapse all v0 v0.0.2 Jan 8, 2023 v0.0.1 Jan 7, 2023 Changes in this version + var DefaultProxy = Proxy(ProxyFuncs{}) + var DefaultProxyFuncs = ProxyFuncs + var ErrRedialAborted = errors.New("unable to restore the connection, aborting") + func Join(local, remote net.Conn, log logging.Logger) + type Backoff interface + NextBackOff func() time.Duration + Reset func() + type Client struct + func NewClient(cfg *ClientConfig) (*Client, error) + func (c *Client) Close() error + func (c *Client) Start() + func (c *Client) StartNotify() <-chan bool + type ClientConfig struct + Backoff Backoff + Debug bool + Dial func(network, address string) (net.Conn, error) + FetchIdentifier func() (string, error) + FetchLocalAddr func(port int) (string, error) + FetchServerAddr func() (string, error) + Identifier string + LocalAddr string + Log logging.Logger + Proxy ProxyFunc + ServerAddr string + StateChanges chan<- *ClientStateChange + YamuxConfig *yamux.Config + type ClientState uint32 + const ClientClosed + const ClientConnected + const ClientConnecting + const ClientDisconnected + const ClientStarted + const ClientUnknown + func (i ClientState) String() string + type ClientStateChange struct + Current ClientState + Error error + Identifier string + Previous ClientState + func (cs *ClientStateChange) String() string + type HTTPProxy struct + ErrorResp *http.Response + FetchLocalAddr func(port int) (string, error) + LocalAddr string + Log logging.Logger + func (p *HTTPProxy) Proxy(remote net.Conn, msg *proto.ControlMessage) + type ProxyFunc func(remote net.Conn, msg *proto.ControlMessage) + func Proxy(p ProxyFuncs) ProxyFunc + type ProxyFuncs struct + HTTP ProxyFunc + TCP ProxyFunc + WS ProxyFunc + type Server struct + func NewServer(cfg *ServerConfig) (*Server, error) + func (s *Server) AddAddr(l net.Listener, ip net.IP, identifier string) + func (s *Server) AddHost(host, identifier string) + func (s *Server) DeleteAddr(l net.Listener, ip net.IP) + func (s *Server) DeleteHost(host string) + func (s *Server) OnConnect(identifier string, fn func() error) + func (s *Server) OnDisconnect(identifier string, fn func() error) + func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) + type ServerConfig struct + Debug bool + Director func(*http.Request) + Log logging.Logger + StateChanges chan<- *ClientStateChange + YamuxConfig *yamux.Config + type TCPProxy struct + FetchLocalAddr func(port int) (string, error) + LocalAddr string + Log logging.Logger + func (p *TCPProxy) Proxy(remote net.Conn, msg *proto.ControlMessage)