Versions in this module Expand all Collapse all v0 v0.30.2 Nov 7, 2020 v0.30.1 Nov 6, 2020 Changes in this version + const FrpWebsocketPath + var ErrWebsocketListenerClosed = errors.New("websocket listener closed") + var FRP_TLS_HEAD_BYTE = 0x17 + func CheckAndEnableTLSServerConnWithTimeout(c net.Conn, tlsConfig *tls.Config, timeout time.Duration) (out net.Conn, err error) + func ConnectServer(protocol string, addr string) (c net.Conn, err error) + func ConnectServerByProxy(proxyURL string, protocol string, addr string) (c net.Conn, err error) + func ConnectServerByProxyWithTLS(proxyUrl string, protocol string, addr string, tlsConfig *tls.Config) (c net.Conn, err error) + func ConnectWebsocketServer(addr string) (net.Conn, error) + func HttpBasicAuth(h http.HandlerFunc, user, passwd string) http.HandlerFunc + func MakeHttpGzipHandler(h http.Handler) http.Handler + func NewContextFromConn(conn net.Conn) context.Context + func NewHttpBasicAuthWraper(h http.Handler, user, passwd string) http.Handler + func NewKcpConnFromUdp(conn *net.UDPConn, connected bool, raddr string) (net.Conn, error) + func NewLogFromConn(conn net.Conn) *xlog.Logger + func WrapCloseNotifyConn(c net.Conn, closeFn func()) net.Conn + func WrapReadWriteCloserToConn(rwc io.ReadWriteCloser, underConn net.Conn) net.Conn + func WrapTLSClientConn(c net.Conn, tlsConfig *tls.Config) (out net.Conn) + type CloseNotifyConn struct + func (cc *CloseNotifyConn) Close() (err error) + type ContextConn struct + func NewContextConn(c net.Conn, ctx context.Context) *ContextConn + func (c *ContextConn) Context() context.Context + func (c *ContextConn) WithContext(ctx context.Context) + type ContextGetter interface + Context func() context.Context + type ContextSetter interface + WithContext func(ctx context.Context) + type CustomListener struct + func NewCustomListener() *CustomListener + func (l *CustomListener) Accept() (net.Conn, error) + func (l *CustomListener) Addr() net.Addr + func (l *CustomListener) Close() error + func (l *CustomListener) PutConn(conn net.Conn) error + type FakeUdpConn struct + func NewFakeUdpConn(l *UdpListener, laddr, raddr net.Addr) *FakeUdpConn + func (c *FakeUdpConn) Close() error + func (c *FakeUdpConn) IsClosed() bool + func (c *FakeUdpConn) LocalAddr() net.Addr + func (c *FakeUdpConn) Read(b []byte) (n int, err error) + func (c *FakeUdpConn) RemoteAddr() net.Addr + func (c *FakeUdpConn) SetDeadline(t time.Time) error + func (c *FakeUdpConn) SetReadDeadline(t time.Time) error + func (c *FakeUdpConn) SetWriteDeadline(t time.Time) error + func (c *FakeUdpConn) Write(b []byte) (n int, err error) + type HttpAuthMiddleware struct + func NewHttpAuthMiddleware(user, passwd string) *HttpAuthMiddleware + func (authMid *HttpAuthMiddleware) Middleware(next http.Handler) http.Handler + type HttpAuthWraper struct + func (aw *HttpAuthWraper) ServeHTTP(w http.ResponseWriter, r *http.Request) + type HttpGzipWraper struct + func (gw *HttpGzipWraper) ServeHTTP(w http.ResponseWriter, r *http.Request) + type KcpListener struct + func ListenKcp(bindAddr string, bindPort int) (l *KcpListener, err error) + func (l *KcpListener) Accept() (net.Conn, error) + func (l *KcpListener) Addr() net.Addr + func (l *KcpListener) Close() error + type StatsConn struct + func WrapStatsConn(conn net.Conn, statsFunc func(total, totalWrite int64)) *StatsConn + func (statsConn *StatsConn) Close() (err error) + func (statsConn *StatsConn) Read(p []byte) (n int, err error) + func (statsConn *StatsConn) Write(p []byte) (n int, err error) + type UdpListener struct + func ListenUDP(bindAddr string, bindPort int) (l *UdpListener, err error) + func (l *UdpListener) Accept() (net.Conn, error) + func (l *UdpListener) Addr() net.Addr + func (l *UdpListener) Close() error + func (l *UdpListener) WriteMsg(buf []byte, remoteAddr *net.UDPAddr) (err error) + type UdpPacket struct + Buf []byte + LocalAddr net.Addr + RemoteAddr net.Addr + type WebsocketListener struct + func ListenWebsocket(bindAddr string, bindPort int) (*WebsocketListener, error) + func NewWebsocketListener(ln net.Listener) (wl *WebsocketListener) + func (p *WebsocketListener) Accept() (net.Conn, error) + func (p *WebsocketListener) Addr() net.Addr + func (p *WebsocketListener) Close() error + type WrapReadWriteCloserConn struct + func (conn *WrapReadWriteCloserConn) LocalAddr() net.Addr + func (conn *WrapReadWriteCloserConn) RemoteAddr() net.Addr + func (conn *WrapReadWriteCloserConn) SetDeadline(t time.Time) error + func (conn *WrapReadWriteCloserConn) SetReadDeadline(t time.Time) error + func (conn *WrapReadWriteCloserConn) SetWriteDeadline(t time.Time) error