Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultAddrFamilyDetectURL = []string{ "http://detectportal.firefox.com/success.txt", "http://204.ustclug.org", } DefaultServerHealthcheck = []string{ "http://www.google.com/generate_204", "http://maps.google.com/generate_204", } )
Functions ¶
This section is empty.
Types ¶
type Advertise ¶ added in v0.10.2
Advertise since the socks5 server can listen to multiple network cards or be reverse-proxyed we need to set an advertising ip and port for example, socks5 UDP ASSOCIATE refers to this address when responding to the client
type Config ¶
type Config struct { // maxmind geoip2 db path Geoip2 string `yaml:"geoip2,omitempty"` // socks5+http proxy server listen addr Listen string `yaml:"listen"` // advertised server addr Advertise *Advertise `yaml:"advertise,omitempty"` // toh server list Servers []*TohServer `yaml:"servers"` // group toh servers Groups []*ServerGroup `yaml:"groups,omitempty"` // local network settings LocalNet *LocalNet `yaml:"localnet,omitempty"` }
type GroupInfo ¶
type GroupInfo struct { Name string `json:"name"` Servers []ServerInfo `json:"servers"` }
type LocalNet ¶ added in v0.12.0
type LocalNet struct { // url that responds to any http status code. dual stack IP should be supported AddrFamilyDetectURL []string `yaml:"afdetect,omitempty"` }
type LocalNetInfo ¶ added in v0.12.0
type Options ¶
type Options struct { // config from file Cfg Config // socks5+http listen address (specify this to override from config) Listen string // data root directory. i.e. $HOME/.config/toh DataRoot string // when using socks5 proxy dns query, if the query dns is consistent with the fake ip // the query request will be processed by the built-in local dns DNSFake []string // build-in local dns listen address DNSListen string // build-in local dns used upstream dns DNSUpstream string // how often query results are completely removed from the cache DNSEvict time.Duration }
type OutboundInfo ¶ added in v0.10.0
type OutboundInfo struct { Group string `json:"group"` Server ServerInfo `json:"server"` Error string `json:"error"` }
type S5Server ¶
type S5Server struct {
// contains filtered or unexported fields
}
func NewS5Server ¶
type ServerGroup ¶
type ServerGroup struct { // name to identify the server group Name string `yaml:"name"` // toh server name list from `servers` section Servers []string `yaml:"servers"` // same as `servers` section Ruleset []string `yaml:"ruleset"` // loadbalancer rule. Round Robin (rr) or Best Latency (bl), default is bl Loadbalancer string `yaml:"loadbalancer"` }
type ServerInfo ¶
type TohServer ¶
type TohServer struct { // name to identify the toh server Name string `yaml:"name"` // toh server adderss. i.e. https://fill-in-your-server-here.toh.sh/ws Addr string `yaml:"addr"` // toh server authcate key Key string `yaml:"key"` // this server is used when the remote accessed by the user hits this ruleset Ruleset []string `yaml:"ruleset,omitempty"` // url that responds to any http status code. dual stack IP should be supported Healthcheck []string `yaml:"healthcheck,omitempty"` // the interval send ping to the under websocket conn for keepalive Keepalive string `yaml:"keepalive,omitempty"` // customize the request header sent to the toh server Headers http.Header `yaml:"headers,omitempty"` }
Click to show internal directories.
Click to hide internal directories.