Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicListener ¶
type Bridge ¶
type Bridge struct { Tag string `json:"tag"` // connect url // * "ws://host/path" // * "wss://host/path" // * "http://host/path" // * "https://host/path" // * "basic://host:port" // * "basic+tls://host:port" URL string `json:"url"` // optional connect address Addr string `json:"addr"` // optional network Network string `json:"network"` // If true, do not verify whether the certificate is valid when connecting to the tls server AllowInsecure bool `json:"allowInsecure"` // http method, default "POST" Method string `json:"method"` // Optional credentials, only valid for http protocol Access string `jsong:"access"` // Specify forwarding destination in "basic" mode Dialer ConnectDialer `json:"dialer"` // ping http default '40s' Ping string `json:"ping"` }
type Config ¶
type Config struct { Logger Logger `json:"logger"` Pool Pool `json:"pool"` // Listener to receive incoming traffic Listener []*Listener `json:"listener"` // Outgoing traffic, how to connect to the remote end Dialer []*Dialer `json:"dialer"` // Outgoing traffic, how to connect to the remote end Bridge []*Bridge `json:"bridge"` }
type ConnectDialer ¶
type Dialer ¶
type Dialer struct { // Must be unique Tag string `json:"tag"` // Connect timeout // Default 500ms Timeout string `json:"timeout"` // connect url // * "ws://host/path" // * "wss://host/path" // * "http://host/path" // * "https://host/path" // * "basic://host:port" // * "basic+tls://host:port" URL string `json:"url"` // optional connect address Addr string `json:"addr"` // optional network Network string `json:"network"` // If true, do not verify whether the certificate is valid when connecting to the tls server AllowInsecure bool `json:"allowInsecure"` // If dialing fails, how many times to retry Retry int `json:"retry"` // http method, default "POST" Method string `json:"method"` // Optional credentials, only valid for http protocol Access string `jsong:"access"` // ping http default '40s' Ping string `json:"ping"` }
type Listener ¶
type Listener struct { BasicListener // work mode, "basic" or "http" or "portal" // default is "basic" Mode string `json:"mode"` // Specify forwarding destination in "basic" mode Dialer ConnectDialer `json:"dialer"` // Specify route for http mode Router []*Router `json:"router"` Portal Portal `json:"portal"` }
Listener to receive incoming traffic
type Router ¶
type Router struct { // POST PUT PATCH WS Method string `json:"method"` // url match pattern Pattern string `json:"pattern"` // Specify forwarding destination Dialer ConnectDialer `json:"dialer"` // Access token, If non-empty, this value will be verified from the header and url parameters. // * 'ws://example.com/anypath?access_token=access_token=Bearer%20' + rawURLBase64(XXXXX) // * curl -H "Authorization: Bearer " + rawURLBase64(XXXXX) Access string `json:"access"` // basic auth Auth []BasicAuth `json:"auth"` // Portal tag, if not emoty, enable portal mode Portal Portal `json:"portal"` FS string `json:"fs"` }
Click to show internal directories.
Click to hide internal directories.