Documentation ¶
Index ¶
Constants ¶
View Source
const ( DEFAULT_TUNNEL_URL = "/" CONFIG_COMMON = "common" CONFIG_LOCAL_ADDR = "local_addr" CONFIG_REMOTE_ADDR = "remote_addr" CONFIG_TUNNEL_ADDR = "tunnel_addr" CONFIG_TUNNEL_URL = "tunnel_url" CONFIG_TOKEN = "Token" CONFIG_SMUX = "IsSmux" CONFIG_MODE = "Mode" )
Variables ¶
View Source
var ( HEADER_REMOTE_ADDR = "REMOTE-ADDR" HEADER_TOKEN = "TOKEN" HEADER_IS_SMUX = "IS_SMUX" HEADER_MODE = "mode" )
Functions ¶
func NewQuitSignal ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(cc *ClientConfig, options ...ClientOption) *Client
func (*Client) ListenAndServe ¶
type ClientConfig ¶
type ClientConfig struct { LocalAddr string RemoteAddr string TunnelAddr string TunnelUrl string Token string IsSmux bool Mode ConnectMode }
func (*ClientConfig) String ¶
func (c *ClientConfig) String() string
type ClientConfigs ¶
type ClientConfigs []*ClientConfig
func NewClientConfigsFromFile ¶
func NewClientConfigsFromFile(configFile string) *ClientConfigs
type ClientOption ¶
type ClientOption func(client *Client)
type ConnectMode ¶
type ConnectMode string
const ( CONNECT_HTTP ConnectMode = "http" CONNECT_WEBSOCKET ConnectMode = "websocket" )
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(sc *ServerConfig, options ...ServerOption) *Server
func (*Server) ListenAndServe ¶
type ServerConfig ¶
func (*ServerConfig) String ¶
func (c *ServerConfig) String() string
type ServerConfigs ¶
type ServerConfigs []*ServerConfig
func NewServerConfigsFrom ¶
func NewServerConfigsFrom(configFile string) *ServerConfigs
type ServerOption ¶
type ServerOption func(server *Server)
Click to show internal directories.
Click to hide internal directories.