Documentation ¶
Index ¶
- func HttpBasicAuth(h http.HandlerFunc, user, passwd string) http.HandlerFunc
- func HttprouterBasicAuth(h httprouter.Handle, user, passwd string) httprouter.Handle
- 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 Conn
- func ConnectServer(protocol string, addr string) (c Conn, err error)
- func ConnectServerByHttpProxy(httpProxy string, protocol string, addr string) (c Conn, err error)
- func ConnectTcpServer(addr string) (c Conn, err error)
- func ConnectTcpServerByHttpProxy(httpProxy string, serverAddr string) (c Conn, err error)
- func WrapConn(c net.Conn) Conn
- func WrapReadWriteCloserToConn(rwc io.ReadWriteCloser, underConn net.Conn) Conn
- type CustomListener
- type 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 HttpAuthWraper
- type HttpGzipWraper
- type KcpListener
- type Listener
- type LogListener
- type SharedConn
- type TcpConn
- type TcpListener
- type UdpListener
- type UdpPacket
- type WrapLogConn
- type WrapReadWriteCloserConn
- 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HttpBasicAuth ¶ added in v0.13.0
func HttpBasicAuth(h http.HandlerFunc, user, passwd string) http.HandlerFunc
func HttprouterBasicAuth ¶ added in v0.13.0
func HttprouterBasicAuth(h httprouter.Handle, user, passwd string) httprouter.Handle
func NewHttpBasicAuthWraper ¶ added in v0.13.0
Types ¶
type Conn ¶
Conn is the interface of connections used in frp.
func ConnectServer ¶ added in v0.12.0
func ConnectServerByHttpProxy ¶ added in v0.12.0
func ConnectTcpServer ¶
func ConnectTcpServerByHttpProxy ¶
ConnectTcpServerByHttpProxy try to connect remote server by http proxy. If httpProxy is empty, it will connect server directly.
func WrapReadWriteCloserToConn ¶ added in v0.11.0
func WrapReadWriteCloserToConn(rwc io.ReadWriteCloser, underConn net.Conn) Conn
type CustomListener ¶ added in v0.13.0
Custom listener
func NewCustomListener ¶ added in v0.13.0
func NewCustomListener() *CustomListener
func (*CustomListener) Accept ¶ added in v0.13.0
func (l *CustomListener) Accept() (Conn, error)
func (*CustomListener) Addr ¶ added in v0.13.0
func (l *CustomListener) Addr() net.Addr
func (*CustomListener) Close ¶ added in v0.13.0
func (l *CustomListener) Close() error
func (*CustomListener) PutConn ¶ added in v0.13.0
func (l *CustomListener) PutConn(conn Conn) error
type FakeUdpConn ¶
func NewFakeUdpConn ¶
func NewFakeUdpConn(l *UdpListener, laddr, raddr net.Addr) *FakeUdpConn
func (*FakeUdpConn) Close ¶
func (c *FakeUdpConn) Close() error
func (*FakeUdpConn) IsClosed ¶
func (c *FakeUdpConn) IsClosed() bool
func (*FakeUdpConn) LocalAddr ¶
func (c *FakeUdpConn) LocalAddr() net.Addr
func (*FakeUdpConn) RemoteAddr ¶
func (c *FakeUdpConn) RemoteAddr() net.Addr
func (*FakeUdpConn) SetDeadline ¶
func (c *FakeUdpConn) SetDeadline(t time.Time) error
func (*FakeUdpConn) SetReadDeadline ¶
func (c *FakeUdpConn) SetReadDeadline(t time.Time) error
func (*FakeUdpConn) SetWriteDeadline ¶
func (c *FakeUdpConn) SetWriteDeadline(t time.Time) error
type HttpAuthWraper ¶ added in v0.13.0
type HttpAuthWraper struct {
// contains filtered or unexported fields
}
func (*HttpAuthWraper) ServeHTTP ¶ added in v0.13.0
func (aw *HttpAuthWraper) ServeHTTP(w http.ResponseWriter, r *http.Request)
type HttpGzipWraper ¶ added in v0.13.0
type HttpGzipWraper struct {
// contains filtered or unexported fields
}
func (*HttpGzipWraper) ServeHTTP ¶ added in v0.13.0
func (gw *HttpGzipWraper) ServeHTTP(w http.ResponseWriter, r *http.Request)
type KcpListener ¶ added in v0.12.0
func ListenKcp ¶ added in v0.12.0
func ListenKcp(bindAddr string, bindPort int64) (l *KcpListener, err error)
func (*KcpListener) Accept ¶ added in v0.12.0
func (l *KcpListener) Accept() (Conn, error)
func (*KcpListener) Close ¶ added in v0.12.0
func (l *KcpListener) Close() error
type Listener ¶
func WrapLogListener ¶ added in v0.12.0
type LogListener ¶ added in v0.12.0
func (*LogListener) Accept ¶ added in v0.12.0
func (logL *LogListener) Accept() (Conn, error)
type SharedConn ¶ added in v0.12.0
type SharedConn struct { // contains filtered or unexported fields }
func NewShareConn ¶ added in v0.12.0
func NewShareConn(conn Conn) (*SharedConn, io.Reader)
the bytes you read in io.Reader, will be reserved in SharedConn
func (*SharedConn) WriteBuff ¶ added in v0.12.0
func (sc *SharedConn) WriteBuff(buffer []byte) (err error)
type TcpListener ¶
func (*TcpListener) Accept ¶
func (l *TcpListener) Accept() (Conn, error)
Wait util get one new connection or listener is closed if listener is closed, err returned.
func (*TcpListener) Close ¶
func (l *TcpListener) Close() error
type UdpListener ¶
func (*UdpListener) Accept ¶
func (l *UdpListener) Accept() (Conn, error)
func (*UdpListener) Close ¶
func (l *UdpListener) Close() error
type WrapReadWriteCloserConn ¶ added in v0.11.0
type WrapReadWriteCloserConn struct { io.ReadWriteCloser log.Logger // contains filtered or unexported fields }
func (*WrapReadWriteCloserConn) LocalAddr ¶ added in v0.11.0
func (conn *WrapReadWriteCloserConn) LocalAddr() net.Addr
func (*WrapReadWriteCloserConn) RemoteAddr ¶ added in v0.11.0
func (conn *WrapReadWriteCloserConn) RemoteAddr() net.Addr
func (*WrapReadWriteCloserConn) SetDeadline ¶ added in v0.11.0
func (conn *WrapReadWriteCloserConn) SetDeadline(t time.Time) error
func (*WrapReadWriteCloserConn) SetReadDeadline ¶ added in v0.11.0
func (conn *WrapReadWriteCloserConn) SetReadDeadline(t time.Time) error
func (*WrapReadWriteCloserConn) SetWriteDeadline ¶ added in v0.11.0
func (conn *WrapReadWriteCloserConn) SetWriteDeadline(t time.Time) error
Click to show internal directories.
Click to hide internal directories.