Documentation ¶
Index ¶
- Constants
- Variables
- func AddConfigs(old []interface{}, new interface{}) (out []interface{})
- func Average(ch chan *smux.Session, ttl int) net.Conn
- func ConnectTo(protocl, dst string) (con net.Conn, err error)
- func Copy(dst io.Writer, src io.Reader) (written int64, err error)
- func ExpressDial(dst string, configs ...interface{}) (con net.Conn, reply []byte, err error)
- func ExpressPipeTo(localConn net.Conn, remoteAddr string, configs ...interface{}) error
- func ExpressSocks5ListenerTo(listenAddr string, remoteAddr string, configs ...interface{})
- func GetMainDomain(urlOrHost string) string
- func ParseSocks5Header(conn net.Conn) (rawaddr []byte, host string, err error)
- func Pipe(p1, p2 net.Conn)
- func SetGlobalTimeout(i int)
- func SetPaswd(pas string)
- func SetReadTimeout(c net.Conn)
- func SetSocks5Handle(f func(host string, con net.Conn))
- func SetWriteTimeout(c *net.Conn)
- func Socks5ConnectedReply(p1 net.Conn) (err error)
- func Socks5HandShake(conn net.Conn) (err error)
- func Socks5Padding(payload string, ports ...int) []byte
- func Socks5Serve(lc net.Conn, configs ...interface{}) (err error)
- func SplitAddr(addr string) (h string, port int)
- func T(i ...interface{})
- func TcpEnd(toDst string, conFrom net.Conn, midledata []byte) error
- func UpdateConfig(old, new *Config)
- func UpdateSession(proxy string, con *smux.Session)
- func WithASession(protocol, proxy string, chs chan *smux.Session) (*smux.Session, error)
- func WrapCloseNotifyConn(c net.Conn, closeFn func()) net.Conn
- type CloseNotifyConn
- type Config
- func (config *Config) GetServerArray() []string
- func (config *Config) ToCertAndKey(name string) (crt_key_paths []string)
- func (config *Config) ToFile(dst string) (err error)
- func (config *Config) ToJson() string
- func (config *Config) ToString() string
- func (config *Config) ToTlsConfig() (tlsConfig *TlsConfig, err error)
- func (config *Config) ToUri() string
- type ExpressListener
- type TlsConfig
- type WebsocketListener
Constants ¶
View Source
const ( CHAIN = "<=CHAIN=>" AddrMask byte = 0xf )
Variables ¶
View Source
var ( SOCKS5_REPY = []byte{0x05, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x43} GLOBALTIMEOUT = 1000 // GLOBALPROTOCOL = "tls" // smuxConfig = smux.DefaultConfig() ServeHandle func(host string, con net.Conn) )
View Source
var ( PASWD = "" /* 4544-byte string literal not displayed */ CENTRY_SERVER_ADDR = "" )
View Source
var ( FrpWebsocketPath2 = "/image123124x123214_download" FrpWebsocketPath = "/benchmark_1000MB.bin" PreDomain = "" )
View Source
var (
ErrWebsocketListenerClosed = errors.New("websocket listener closed")
)
Functions ¶
func AddConfigs ¶
func AddConfigs(old []interface{}, new interface{}) (out []interface{})
func Copy ¶
Base -=-------------------------------------------------------------------------------------
func ExpressDial ¶
func ExpressPipeTo ¶
func ExpressSocks5ListenerTo ¶
func GetMainDomain ¶
func ParseSocks5Header ¶
func SetGlobalTimeout ¶
func SetGlobalTimeout(i int)
func SetReadTimeout ¶
func SetSocks5Handle ¶ added in v1.0.1
func SetWriteTimeout ¶
func Socks5ConnectedReply ¶
func Socks5HandShake ¶
func Socks5Padding ¶
func Socks5Serve ¶
func UpdateConfig ¶
func UpdateConfig(old, new *Config)
UpdateConfig : Useful for command line to override options specified in config file Debug is not updated.
func UpdateSession ¶
func WithASession ¶
Types ¶
type CloseNotifyConn ¶
func (*CloseNotifyConn) Close ¶
func (cc *CloseNotifyConn) Close() (err error)
type Config ¶
type Config struct { Server interface{} `json:"server"` ServerPort int `json:"server_port"` LocalPort int `json:"local_port"` LocalAddress string `json:"local_address"` Password string `json:"password"` Method string `json:"method"` // encryption method // following options are only used by server PortPassword map[string]string `json:"port_password"` Timeout int `json:"timeout"` // The order of servers in the client config is significant, so use array // instead of map to preserve the order. ServerPassword string `json:"server_password"` }
func ParseConfig ¶
ParseConfig parse path to json
func (*Config) GetServerArray ¶
GetServerArray get server
func (*Config) ToCertAndKey ¶
will cache to locl file syste,with ${tmp}/name.crt | ${tmp}/name.key
func (*Config) ToTlsConfig ¶
type ExpressListener ¶
type ExpressListener struct { Sessions chan *smux.Session // contains filtered or unexported fields }
func ExpressListenWith ¶
func ExpressListenWith(addr string, configs ...interface{}) (lst *ExpressListener, err error)
func (*ExpressListener) Accept ¶
func (expressLst *ExpressListener) Accept() (con net.Conn, err error)
func (*ExpressListener) Addr ¶
func (expressLst *ExpressListener) Addr() net.Addr
Addr returns the listener's network address.
func (*ExpressListener) Backend ¶
func (lst *ExpressListener) Backend()
func (*ExpressListener) Close ¶
func (expressLst *ExpressListener) Close() error
Close closes the listener. Any blocked Accept operations will be unblocked and return errors.
type TlsConfig ¶
type TlsConfig struct { Ca x509.CertPool Cert tls.Certificate Server string // contains filtered or unexported fields }
func UseDefaultTlsConfig ¶
func (*TlsConfig) GenerateConfig ¶
type WebsocketListener ¶
type WebsocketListener struct {
// contains filtered or unexported fields
}
func NewWebsocketListener ¶
func NewWebsocketListener(ln net.Listener, certFile_keyFile ...string) (wl *WebsocketListener)
NewWebsocketListener to handle websocket connections ln: tcp listener for websocket connections
func UseWebSocketListener ¶
func UseWebSocketListener(listenAddr string, useTls bool) (*WebsocketListener, error)
func (*WebsocketListener) Addr ¶
func (p *WebsocketListener) Addr() net.Addr
func (*WebsocketListener) Close ¶
func (p *WebsocketListener) Close() error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.