Documentation ¶
Overview ¶
Package chained provides a chained proxy that can proxy any tcp traffic over any underlying transport through a remote proxy. The downstream (client) side of the chained setup is just a dial function. The upstream (server) side is just an http.Handler. The client tells the server where to connect using an HTTP CONNECT request.
Index ¶
- Variables
- func ActivelyObtainBrowserHello(ctx context.Context, configDir string) (*helloSpec, error)
- func CopyConfig(pc *config.ProxyConfig) *config.ProxyConfig
- func CopyConfigs(proxies map[string]*config.ProxyConfig) map[string]*config.ProxyConfig
- func CreateDialer(configDir, name string, s *config.ProxyConfig, uc common.UserConfig) (bandit.Dialer, error)
- func CreateDialers(configDir string, proxies map[string]*config.ProxyConfig, uc common.UserConfig) []bandit.Dialer
- func CreateDialersMap(configDir string, proxies map[string]*config.ProxyConfig, uc common.UserConfig) map[string]bandit.Dialer
- func CreateMPDialer(configDir, endpoint string, ss map[string]*config.ProxyConfig, ...) (bandit.Dialer, error)
- func ForceProxy(forceAddr string, forceToken string)
- func PersistSessionStates(configDir string)
- func TrackStatsFor(dialers []bandit.Dialer, configDir string)
- type KCPConfig
- type Server
Constants ¶
This section is empty.
Variables ¶
var ( // IdleTimeout closes connections idle for a period to avoid dangling // connections. Web applications tend to contact servers in 1 minute // interval or below. 65 seconds is long enough to avoid interrupt normal // connections but shorter than the idle timeout on the server to avoid // running into closed connection problems. IdleTimeout = 65 * time.Second )
var InsecureSkipVerifyTLSMasqOrigin = false
InsecureSkipVerifyTLSMasqOrigin controls whether the origin certificate is verified when dialing a tlsmasq proxy. This can be used when testing against origins with self-signed certificates. This should be false in production as allowing a 3rd party to impersonate the origin could allow for a kind of probe.
Functions ¶
func ActivelyObtainBrowserHello ¶ added in v7.6.46
ActivelyObtainBrowserHello obtains a sample TLS ClientHello via listening for local traffic.
func CopyConfig ¶
func CopyConfig(pc *config.ProxyConfig) *config.ProxyConfig
CopyConfig makes a safe copy of the config to avoid any data corruption for other users of the config.
func CopyConfigs ¶
func CopyConfigs(proxies map[string]*config.ProxyConfig) map[string]*config.ProxyConfig
CopyConfigs makes a safe copy of the config to avoid any data corruption for other users of the config.
func CreateDialer ¶
func CreateDialer(configDir, name string, s *config.ProxyConfig, uc common.UserConfig) (bandit.Dialer, error)
CreateDialer creates a Proxy (balancer.Dialer) with supplied server info.
func CreateDialers ¶
func CreateDialers(configDir string, proxies map[string]*config.ProxyConfig, uc common.UserConfig) []bandit.Dialer
CreateDialers creates a list of Proxies (bandit.Dialer) with supplied server info.
func CreateDialersMap ¶
func CreateDialersMap(configDir string, proxies map[string]*config.ProxyConfig, uc common.UserConfig) map[string]bandit.Dialer
CreateDialersMap creates a map of Proxies (bandit.Dialer) with supplied server info.
func CreateMPDialer ¶
func CreateMPDialer(configDir, endpoint string, ss map[string]*config.ProxyConfig, uc common.UserConfig) (bandit.Dialer, error)
func ForceProxy ¶
ForceProxy forces everything through the HTTP proxy at forceAddr using forceToken.
func PersistSessionStates ¶
func PersistSessionStates(configDir string)
PersistSessionStates makes sure that session states are stored on disk in the given configDir
func TrackStatsFor ¶
TrackStatsFor enables periodic checkpointing of the given proxies' stats to disk.
Types ¶
type KCPConfig ¶
type KCPConfig struct { kcpwrapper.DialerConfig `mapstructure:",squash"` RemoteAddr string `json:"remoteaddr"` }
KCPConfig adapts kcpwrapper.DialerConfig to the currently deployed configurations in order to provide backward-compatibility.
type Server ¶
type Server struct { // Dial: function for dialing destination Dial func(network, address string) (net.Conn, error) }
Server provides the upstream side of a chained proxy setup. It can be run as a standalone HTTP server using Serve() or plugged into an existing HTTP server as an http.Handler.
Source Files ¶
- algeneva_impl.go
- broflake_impl.go
- common.go
- dialer.go
- frontedtransport.go
- hello_roller.go
- http_impl.go
- https_impl.go
- kcp_impl.go
- lampshade_impl.go
- multipath.go
- multiplexed_impl.go
- persist.go
- preconnecting_dialer.go
- proxy.go
- quic_impl.go
- server.go
- session_caching.go
- shadowsocks_impl.go
- starbridge_impl.go
- tls_config.go
- tls_config_other.go
- tls_file_cache.go
- tlsfrag.go
- tlsmasq_impl.go
- wss_impl.go