Versions in this module Expand all Collapse all v0 v0.0.1 Nov 22, 2024 Changes in this version + const SO_ORIGINAL_DST — darwin/amd64, js/wasm, linux/amd64 + const UserPassAuth + func GetServerNameFromClientHello(c net.Conn) (string, []byte) + func HandleTrans(c *conn.Conn, s *TunnelModeServer) error + func IsGlobalBlackIp(ipPort string) bool + func IsWebsocketRequest(req *http.Request) bool + func Join(c1 io.ReadWriteCloser, c2 io.ReadWriteCloser, host *file.Host) (inCount int64, outCount int64) + func NewHTTPError(code int, errmsg string) error + func NewHttp(bridge *bridge.Bridge, c *file.Tunnel, httpPort, httpsPort int, useCache bool, ...) *httpServer + func ProcessHttp(c *conn.Conn, s *TunnelModeServer) error + func ProcessTunnel(c *conn.Conn, s *TunnelModeServer) error + type BaseServer struct + func NewBaseServer(bridge *bridge.Bridge, task *file.Tunnel) *BaseServer + func (s *BaseServer) CheckFlowAndConnNum(client *file.Client) error + func (s *BaseServer) DealClient(c *conn.Conn, client *file.Client, addr string, rb []byte, tp string, f func(), ...) error + func (s *BaseServer) FlowAdd(in, out int64) + func (s *BaseServer) FlowAddHost(host *file.Host, in, out int64) + type HTTPError struct + HTTPCode int + type HttpReverseProxy struct + func NewHttpReverseProxy(s *httpServer) *HttpReverseProxy + func (rp *HttpReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) + type HttpsListener struct + func NewHttpsListener(l net.Listener) *HttpsListener + func (httpsListener *HttpsListener) Accept() (net.Conn, error) + func (httpsListener *HttpsListener) Addr() net.Addr + func (httpsListener *HttpsListener) Close() error + type HttpsServer struct + func NewHttpsServer(l net.Listener, bridge NetBridge, useCache bool, cacheLen int) *HttpsServer + func (https *HttpsServer) Close() error + func (https *HttpsServer) NewHttps(l net.Listener, certFile string, keyFile string) + func (https *HttpsServer) Start() error + func (s *HttpsServer) NewServer(port int, scheme string) *http.Server + func (s *HttpsServer) NewServerWithTls(port int, scheme string, l net.Listener, certFile string, keyFile string) error + type NetBridge interface + SendLinkInfo func(clientId int, link *conn.Link, t *file.Tunnel) (target net.Conn, err error) + type P2PServer struct + func NewP2PServer(p2pPort int) *P2PServer + func (s *P2PServer) Start() error + type ReverseProxy struct + WebSocketDialContext func(ctx context.Context, network, addr string) (net.Conn, error) + func NewReverseProxy(orp *httputil.ReverseProxy) *ReverseProxy + func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request, host *file.Host) + type Service interface + Close func() error + Start func() error + type Sock5ModeServer struct + func NewSock5ModeServer(bridge NetBridge, task *file.Tunnel) *Sock5ModeServer + func (s *Sock5ModeServer) Auth(c net.Conn) error + func (s *Sock5ModeServer) Close() error + func (s *Sock5ModeServer) Start() error + type TunnelModeServer struct + func NewTunnelModeServer(process process, bridge NetBridge, task *file.Tunnel) *TunnelModeServer + func (s *TunnelModeServer) Close() error + func (s *TunnelModeServer) Start() error + type UdpModeServer struct + func NewUdpModeServer(bridge *bridge.Bridge, task *file.Tunnel) *UdpModeServer + func (s *UdpModeServer) Close() error + func (s *UdpModeServer) Start() error + type WebServer struct + func NewWebServer(bridge *bridge.Bridge) *WebServer + func (s *WebServer) Close() error + func (s *WebServer) Start() error