Versions in this module Expand all Collapse all v0 v0.29.3 Nov 7, 2020 v0.29.2 Nov 5, 2020 Changes in this version + const FrpWebsocketPath + var ErrWebsocketListenerClosed = errors.New("websocket listener closed") + var FRP_TLS_HEAD_BYTE = 0x17 + func HttpBasicAuth(h http.HandlerFunc, user, passwd string) http.HandlerFunc + func MakeHttpGzipHandler(h http.Handler) http.Handler + func NewHttpBasicAuthWraper(h http.Handler, user, passwd string) http.Handler + func NewKcpConnFromUdp(conn *net.UDPConn, connected bool, raddr string) (net.Conn, error) + type CloseNotifyConn struct + func (cc *CloseNotifyConn) Close() (err error) + type Conn interface + func CheckAndEnableTLSServerConnWithTimeout(c net.Conn, tlsConfig *tls.Config, timeout time.Duration) (out Conn, err error) + func ConnectServer(protocol string, addr string) (c Conn, err error) + func ConnectServerByProxy(proxyUrl string, protocol string, addr string) (c Conn, err error) + func ConnectServerByProxyWithTLS(proxyUrl string, protocol string, addr string, tlsConfig *tls.Config) (c Conn, err error) + func ConnectTcpServer(addr string) (c Conn, err error) + func ConnectWebsocketServer(addr string) (Conn, error) + func WrapCloseNotifyConn(c net.Conn, closeFn func()) Conn + func WrapConn(c net.Conn) Conn + func WrapReadWriteCloserToConn(rwc io.ReadWriteCloser, underConn net.Conn) Conn + func WrapTLSClientConn(c net.Conn, tlsConfig *tls.Config) (out Conn) + type CustomListener struct + func NewCustomListener() *CustomListener + func (l *CustomListener) Accept() (Conn, error) + func (l *CustomListener) Addr() net.Addr + func (l *CustomListener) Close() error + func (l *CustomListener) PutConn(conn 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() (Conn, error) + func (l *KcpListener) Close() error + type Listener interface + Accept func() (Conn, error) + Close func() error + func WrapLogListener(l net.Listener) Listener + type LogListener struct + func (logL *LogListener) Accept() (Conn, error) + func (logL *LogListener) Close() error + type StatsConn struct + func WrapStatsConn(conn 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 TcpConn struct + func NewTcpConn(conn net.Conn) (c *TcpConn) + type TcpListener struct + func ListenTcp(bindAddr string, bindPort int) (l *TcpListener, err error) + func (l *TcpListener) Accept() (Conn, error) + func (l *TcpListener) Close() error + type UdpListener struct + func ListenUDP(bindAddr string, bindPort int) (l *UdpListener, err error) + func (l *UdpListener) Accept() (Conn, error) + 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() (Conn, error) + func (p *WebsocketListener) Close() error + type WrapLogConn struct + 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