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, only websocket handshake is used, and tcp communication is used directly after the handshake is successful. Fast bool `json:"fast"` // 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"` // A reverse bridge Bridge []*Bridge `json:"bridge"` // udp forward UDP []*UDPForward `json:"udp"` }
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, only websocket handshake is used, and tcp communication is used directly after the handshake is successful. Fast bool `json:"fast"` // 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"` // http client header Header map[string][]string `json:"header"` // udp settings UDP UDP `json:"udp"` }
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"` // udp settings UDP UDP `json:"udp"` }
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"` // If true, only websocket handshake is used, and tcp communication is used directly after the handshake is successful. Fast bool `json:"fast"` FS string `json:"fs"` }
type TLS ¶
type TLS struct { CertFile string `json:"certFile"` KeyFile string `json:"keyFile"` Cert string `json:"cert"` Key string `json:"key"` Alpn []string `json:"alpn"` }
func (*TLS) Certificate ¶
type UDPForward ¶ added in v0.0.5
type UDPForward struct { // log tag Tag string `json:"tag"` // "udp" "udp4" "udp6" Network string `json:"network"` // udp listen host:port Listen string `json:"listen"` // remote target addr To string `json:"to"` // udp max frame length, default 1024*2 Size int `json:"size"` // udp timeout, default 3m Timeout string `json:"timeout"` }
Click to show internal directories.
Click to hide internal directories.