Documentation
¶
Index ¶
- Constants
- Variables
- func Daemon(godaemon bool)
- func DecodeCipherMethod(b byte) string
- func EncodeCipherMethod(m string) byte
- func ExampleJSONConfig() string
- func NewDNSForwardServer() *dns.Server
- func PrintVersion()
- func UpdateConfig(old, ne *Config)
- type Config
- type ConnState
- func (cs *ConnState) CloseWait(conn io.ReadWriteCloser) *ConnState
- func (cs *ConnState) Closed(conn io.ReadWriteCloser) *ConnState
- func (cs *ConnState) Closing(conn io.ReadWriteCloser) *ConnState
- func (cs *ConnState) FINWait1(conn io.ReadWriteCloser) *ConnState
- func (cs *ConnState) FINWait2(conn io.ReadWriteCloser) *ConnState
- func (cs *ConnState) LastACK(conn io.ReadWriteCloser) *ConnState
- func (cs *ConnState) TimeWait(conn io.ReadWriteCloser) *ConnState
- type ConnStateFn
- type DirectUDPExchange
- type Easyss
- func (ss *Easyss) BindAll() bool
- func (ss *Easyss) Close()
- func (ss *Easyss) CloseTun2socks() error
- func (ss *Easyss) ConfigFilename() string
- func (ss *Easyss) CreateTun2socks(status Tun2socksStatus) error
- func (ss *Easyss) DNSCache(name, qtype string, isDirect bool) *dns.Msg
- func (ss *Easyss) DisableUTLS() bool
- func (ss *Easyss) EnableForwardDNS() bool
- func (ss *Easyss) HostAtCNOrPrivate(host string) bool
- func (ss *Easyss) IPAtCNOrPrivate(ip string) bool
- func (ss *Easyss) InitTcpPool() error
- func (ss *Easyss) LocalAddr() string
- func (ss *Easyss) LocalDNSForward() error
- func (ss *Easyss) LocalDevice() string
- func (ss *Easyss) LocalDeviceIndex() int
- func (ss *Easyss) LocalGateway() string
- func (ss *Easyss) LocalHttp() error
- func (ss *Easyss) LocalHttpProxyPort() int
- func (ss *Easyss) LocalPacPort() int
- func (ss *Easyss) LocalPort() int
- func (ss *Easyss) LocalSocks5() error
- func (ss *Easyss) Method() string
- func (ss *Easyss) Password() string
- func (ss *Easyss) Pool() easypool.Pool
- func (ss *Easyss) Remote()
- func (ss *Easyss) RenewDNSCache(name, qtype string, isDirect bool)
- func (ss *Easyss) Server() string
- func (ss *Easyss) ServerAddr() string
- func (ss *Easyss) ServerDNSMsg() (*dns.Msg, error)
- func (ss *Easyss) ServerIP() string
- func (ss *Easyss) ServerPort() int
- func (ss *Easyss) SetDNSCache(msg *dns.Msg, noExpire, isDirect bool) error
- func (ss *Easyss) SetDNSCacheIfNeeded(udpResp []byte, isDirect bool)
- func (ss *Easyss) SetForwardDNSServer(server *dns.Server)
- func (ss *Easyss) SetHttpProxyServer(server *http.Server)
- func (ss *Easyss) SetPool(pool easypool.Pool)
- func (ss *Easyss) SetSocksServer(server *socks5.Server)
- func (ss *Easyss) SetTun2socksStatus(status Tun2socksStatus)
- func (ss *Easyss) Socks5ProxyAddr() string
- func (ss *Easyss) TCPHandle(s *socks5.Server, conn *net.TCPConn, r *socks5.Request) error
- func (ss *Easyss) Timeout() time.Duration
- func (ss *Easyss) Tun2socksModelFromConfig() string
- func (ss *Easyss) Tun2socksStatus() Tun2socksStatus
- func (ss *Easyss) Tun2socksStatusAuto() bool
- func (ss *Easyss) Tun2socksStatusOff() bool
- func (ss *Easyss) Tun2socksStatusOn() bool
- func (ss *Easyss) UDPHandle(s *socks5.Server, addr *net.UDPAddr, d *socks5.Datagram) error
- type GeoSite
- type Statistics
- type Tun2socksStatus
- type UDPExchange
Constants ¶
View Source
const ( ESTABLISHED state = iota FIN_WAIT1 FIN_WAIT2 LAST_ACK CLOSING CLOSE_WAIT TIME_WAIT CLOSED )
View Source
const ( MaxUDPDataSize = 65507 DefaultDNSServer = "8.8.8.8:53" )
View Source
const ( TunDevice = "tun-easyss" TunDeviceDarwin = "utun9" TunIP = "198.18.0.1" TunGW = "198.18.0.1" TunMask = "255.255.0.0" TunIPSub = "198.18.0.1/16" )
View Source
const DefaultDirectDNSServer = "119.29.29.29:53"
View Source
const DefaultUDPTimeout = 10 * time.Second
View Source
const DirectSuffix = "direct"
Variables ¶
View Source
var T2SSStringToType = map[string]Tun2socksStatus{ "off": Tun2socksStatusOff, "auto": Tun2socksStatusAuto, "on": Tun2socksStatusOn, }
View Source
var T2SSTypeToString = map[Tun2socksStatus]string{ Tun2socksStatusOff: "off", Tun2socksStatusAuto: "auto", Tun2socksStatusOn: "on", }
Functions ¶
func DecodeCipherMethod ¶
func EncodeCipherMethod ¶
func ExampleJSONConfig ¶ added in v1.4.0
func ExampleJSONConfig() string
func NewDNSForwardServer ¶ added in v1.5.0
func PrintVersion ¶
func PrintVersion()
func UpdateConfig ¶
func UpdateConfig(old, ne *Config)
Types ¶
type Config ¶
type Config struct { Server string `json:"server"` ServerPort int `json:"server_port"` LocalPort int `json:"local_port"` Password string `json:"password"` Method string `json:"method"` // encryption method Timeout int `json:"timeout"` BindALL bool `json:"bind_all"` DisableUTLS bool `json:"disable_utls"` EnableForwardDNS bool `json:"enable_forward_dns"` Tun2socksModel string `json:"tun2socks_model"` ConfigFile string `json:"-"` }
func ParseConfig ¶
type ConnState ¶
type ConnState struct {
// contains filtered or unexported fields
}
func NewConnState ¶
type ConnStateFn ¶
type ConnStateFn func(conn io.ReadWriteCloser) *ConnState
type DirectUDPExchange ¶ added in v1.5.0
type DirectUDPExchange struct { ClientAddr *net.UDPAddr RemoteConn net.PacketConn }
DirectUDPExchange used to store client address and remote connection
type Easyss ¶
type Easyss struct {
// contains filtered or unexported fields
}
func (*Easyss) CloseTun2socks ¶ added in v1.5.0
func (*Easyss) ConfigFilename ¶ added in v1.4.0
func (*Easyss) CreateTun2socks ¶ added in v1.5.0
func (ss *Easyss) CreateTun2socks(status Tun2socksStatus) error
func (*Easyss) DisableUTLS ¶ added in v1.5.0
func (*Easyss) EnableForwardDNS ¶ added in v1.5.0
func (*Easyss) HostAtCNOrPrivate ¶ added in v1.5.0
func (*Easyss) IPAtCNOrPrivate ¶ added in v1.5.0
func (*Easyss) InitTcpPool ¶
func (*Easyss) LocalDNSForward ¶ added in v1.5.0
func (*Easyss) LocalDevice ¶ added in v1.5.0
func (*Easyss) LocalDeviceIndex ¶ added in v1.5.0
func (*Easyss) LocalGateway ¶ added in v1.5.0
func (*Easyss) LocalHttpProxyPort ¶ added in v1.4.0
func (*Easyss) LocalPacPort ¶ added in v1.4.0
func (*Easyss) LocalSocks5 ¶ added in v1.4.0
func (*Easyss) RenewDNSCache ¶ added in v1.5.0
func (*Easyss) ServerAddr ¶ added in v1.5.0
func (*Easyss) ServerPort ¶
func (*Easyss) SetDNSCache ¶ added in v1.5.0
func (*Easyss) SetDNSCacheIfNeeded ¶ added in v1.5.0
func (*Easyss) SetForwardDNSServer ¶ added in v1.5.0
func (*Easyss) SetHttpProxyServer ¶ added in v1.4.0
func (*Easyss) SetSocksServer ¶ added in v1.4.0
func (*Easyss) SetTun2socksStatus ¶ added in v1.5.0
func (ss *Easyss) SetTun2socksStatus(status Tun2socksStatus)
func (*Easyss) Socks5ProxyAddr ¶ added in v1.5.0
func (*Easyss) Tun2socksModelFromConfig ¶ added in v1.5.0
func (*Easyss) Tun2socksStatus ¶ added in v1.5.0
func (ss *Easyss) Tun2socksStatus() Tun2socksStatus
func (*Easyss) Tun2socksStatusAuto ¶ added in v1.5.0
func (*Easyss) Tun2socksStatusOff ¶ added in v1.5.0
func (*Easyss) Tun2socksStatusOn ¶ added in v1.5.0
type GeoSite ¶ added in v1.5.0
type GeoSite struct {
// contains filtered or unexported fields
}
func NewGeoSite ¶ added in v1.5.0
type Statistics ¶ added in v1.1.0
type Tun2socksStatus ¶ added in v1.5.0
type Tun2socksStatus int
const ( Tun2socksStatusOff Tun2socksStatus = iota Tun2socksStatusAuto Tun2socksStatusOn )
func (Tun2socksStatus) String ¶ added in v1.5.0
func (t2ss Tun2socksStatus) String() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.