Documentation ¶
Index ¶
- type ClientHttpConnection
- func (c ClientHttpConnection) Close() error
- func (c ClientHttpConnection) LocalAddr() net.Addr
- func (c ClientHttpConnection) Read(b []byte) (n int, err error)
- func (c ClientHttpConnection) RemoteAddr() net.Addr
- func (c ClientHttpConnection) SetDeadline(t time.Time) error
- func (c ClientHttpConnection) SetReadDeadline(t time.Time) error
- func (c ClientHttpConnection) SetWriteDeadline(t time.Time) error
- func (c ClientHttpConnection) Write(b []byte) (n int, err error)
- type ClientHttpDialer
- type ClientUdpConnection
- func (u ClientUdpConnection) Close() error
- func (u ClientUdpConnection) LocalAddr() net.Addr
- func (u ClientUdpConnection) Read(b []byte) (n int, err error)
- func (u ClientUdpConnection) RemoteAddr() net.Addr
- func (u ClientUdpConnection) SetDeadline(t time.Time) error
- func (u ClientUdpConnection) SetReadDeadline(t time.Time) error
- func (u ClientUdpConnection) SetWriteDeadline(t time.Time) error
- func (u ClientUdpConnection) Write(b []byte) (n int, err error)
- type ServerHttpConnection
- func (c ServerHttpConnection) Close() error
- func (c ServerHttpConnection) LocalAddr() net.Addr
- func (c ServerHttpConnection) Read(b []byte) (n int, err error)
- func (c ServerHttpConnection) RemoteAddr() net.Addr
- func (c ServerHttpConnection) SetDeadline(t time.Time) error
- func (c ServerHttpConnection) SetReadDeadline(t time.Time) error
- func (c ServerHttpConnection) SetWriteDeadline(t time.Time) error
- func (c ServerHttpConnection) Write(b []byte) (n int, err error)
- type ServerUdpConnection
- func (u ServerUdpConnection) Close() error
- func (u ServerUdpConnection) IsClosed() bool
- func (u ServerUdpConnection) LocalAddr() net.Addr
- func (u ServerUdpConnection) Read(b []byte) (n int, err error)
- func (u ServerUdpConnection) RemoteAddr() net.Addr
- func (u ServerUdpConnection) SetDeadline(t time.Time) error
- func (u ServerUdpConnection) SetReadDeadline(t time.Time) error
- func (u ServerUdpConnection) SetWriteDeadline(t time.Time) error
- func (u ServerUdpConnection) Write(b []byte) (n int, err error)
- type TunnelDialer
- type TunnelProtocol
- type TunnelServer
- type TunnelServerCommon
- type UdpPacket
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientHttpConnection ¶
type ClientHttpConnection struct { net.Conn Connection net.Conn Client http.Client ServerUrl string RandomGen *rand.Rand Ch chan []byte // contains filtered or unexported fields }
func GetCilentHttpConnection ¶
func GetCilentHttpConnection(proto, serverUrl string) (ClientHttpConnection, error)
func (ClientHttpConnection) Close ¶
func (c ClientHttpConnection) Close() error
Close closes the connection. Any blocked Read or Write operations will be unblocked and return errors.
func (ClientHttpConnection) LocalAddr ¶
func (c ClientHttpConnection) LocalAddr() net.Addr
LocalAddr returns the local network address.
func (ClientHttpConnection) RemoteAddr ¶
func (c ClientHttpConnection) RemoteAddr() net.Addr
RemoteAddr returns the remote network address.
func (ClientHttpConnection) SetDeadline ¶
func (c ClientHttpConnection) SetDeadline(t time.Time) error
SetDeadline sets the read and write deadlines associated with the connection. It is equivalent to calling both SetReadDeadline and SetWriteDeadline.
A deadline is an absolute time after which I/O operations fail with a timeout (see type Error) instead of blocking. The deadline applies to all future and pending I/O, not just the immediately following call to Read or Write. After a deadline has been exceeded, the connection can be refreshed by setting a deadline in the future.
An idle timeout can be implemented by repeatedly extending the deadline after successful Read or Write calls.
A zero value for t means I/O operations will not time out.
func (ClientHttpConnection) SetReadDeadline ¶
func (c ClientHttpConnection) SetReadDeadline(t time.Time) error
SetReadDeadline sets the deadline for future Read calls and any currently-blocked Read call. A zero value for t means Read will not time out.
func (ClientHttpConnection) SetWriteDeadline ¶
func (c ClientHttpConnection) SetWriteDeadline(t time.Time) error
SetWriteDeadline sets the deadline for future Write calls and any currently-blocked Write call. Even if write times out, it may return n > 0, indicating that some of the data was successfully written. A zero value for t means Write will not time out.
type ClientHttpDialer ¶
type ClientUdpConnection ¶
type ClientUdpConnection struct { net.Conn Connection *net.UDPConn Buffer []byte Reader *bufio.Reader }
func (ClientUdpConnection) Close ¶
func (u ClientUdpConnection) Close() error
Close closes the connection. Any blocked Read or Write operations will be unblocked and return errors.
func (ClientUdpConnection) LocalAddr ¶
func (u ClientUdpConnection) LocalAddr() net.Addr
LocalAddr returns the local network address.
func (ClientUdpConnection) RemoteAddr ¶
func (u ClientUdpConnection) RemoteAddr() net.Addr
RemoteAddr returns the remote network address.
func (ClientUdpConnection) SetDeadline ¶
func (u ClientUdpConnection) SetDeadline(t time.Time) error
SetDeadline sets the read and write deadlines associated with the connection. It is equivalent to calling both SetReadDeadline and SetWriteDeadline.
A deadline is an absolute time after which I/O operations fail with a timeout (see type Error) instead of blocking. The deadline applies to all future and pending I/O, not just the immediately following call to Read or Write. After a deadline has been exceeded, the connection can be refreshed by setting a deadline in the future.
An idle timeout can be implemented by repeatedly extending the deadline after successful Read or Write calls.
A zero value for t means I/O operations will not time out.
func (ClientUdpConnection) SetReadDeadline ¶
func (u ClientUdpConnection) SetReadDeadline(t time.Time) error
SetReadDeadline sets the deadline for future Read calls and any currently-blocked Read call. A zero value for t means Read will not time out.
func (ClientUdpConnection) SetWriteDeadline ¶
func (u ClientUdpConnection) SetWriteDeadline(t time.Time) error
SetWriteDeadline sets the deadline for future Write calls and any currently-blocked Write call. Even if write times out, it may return n > 0, indicating that some of the data was successfully written. A zero value for t means Write will not time out.
type ServerHttpConnection ¶
type ServerHttpConnection struct { net.Conn RCh chan []byte WCh chan []byte LastUsed time.Time Closed bool }
func GetServerHttpConnection ¶
func GetServerHttpConnection() ServerHttpConnection
func (ServerHttpConnection) Close ¶
func (c ServerHttpConnection) Close() error
Close closes the connection. Any blocked Read or Write operations will be unblocked and return errors.
func (ServerHttpConnection) LocalAddr ¶
func (c ServerHttpConnection) LocalAddr() net.Addr
LocalAddr returns the local network address.
func (ServerHttpConnection) RemoteAddr ¶
func (c ServerHttpConnection) RemoteAddr() net.Addr
RemoteAddr returns the remote network address.
func (ServerHttpConnection) SetDeadline ¶
func (c ServerHttpConnection) SetDeadline(t time.Time) error
SetDeadline sets the read and write deadlines associated with the connection. It is equivalent to calling both SetReadDeadline and SetWriteDeadline.
A deadline is an absolute time after which I/O operations fail with a timeout (see type Error) instead of blocking. The deadline applies to all future and pending I/O, not just the immediately following call to Read or Write. After a deadline has been exceeded, the connection can be refreshed by setting a deadline in the future.
An idle timeout can be implemented by repeatedly extending the deadline after successful Read or Write calls.
A zero value for t means I/O operations will not time out.
func (ServerHttpConnection) SetReadDeadline ¶
func (c ServerHttpConnection) SetReadDeadline(t time.Time) error
SetReadDeadline sets the deadline for future Read calls and any currently-blocked Read call. A zero value for t means Read will not time out.
func (ServerHttpConnection) SetWriteDeadline ¶
func (c ServerHttpConnection) SetWriteDeadline(t time.Time) error
SetWriteDeadline sets the deadline for future Write calls and any currently-blocked Write call. Even if write times out, it may return n > 0, indicating that some of the data was successfully written. A zero value for t means Write will not time out.
type ServerUdpConnection ¶
type ServerUdpConnection struct { net.Conn Connection *net.UDPConn Addr *net.UDPAddr RCh chan []byte WCh chan UdpPacket Closed bool }
func (ServerUdpConnection) Close ¶
func (u ServerUdpConnection) Close() error
Close closes the connection. Any blocked Read or Write operations will be unblocked and return errors.
func (ServerUdpConnection) IsClosed ¶
func (u ServerUdpConnection) IsClosed() bool
func (ServerUdpConnection) LocalAddr ¶
func (u ServerUdpConnection) LocalAddr() net.Addr
LocalAddr returns the local network address.
func (ServerUdpConnection) RemoteAddr ¶
func (u ServerUdpConnection) RemoteAddr() net.Addr
RemoteAddr returns the remote network address.
func (ServerUdpConnection) SetDeadline ¶
func (u ServerUdpConnection) SetDeadline(t time.Time) error
SetDeadline sets the read and write deadlines associated with the connection. It is equivalent to calling both SetReadDeadline and SetWriteDeadline.
A deadline is an absolute time after which I/O operations fail with a timeout (see type Error) instead of blocking. The deadline applies to all future and pending I/O, not just the immediately following call to Read or Write. After a deadline has been exceeded, the connection can be refreshed by setting a deadline in the future.
An idle timeout can be implemented by repeatedly extending the deadline after successful Read or Write calls.
A zero value for t means I/O operations will not time out.
func (ServerUdpConnection) SetReadDeadline ¶
func (u ServerUdpConnection) SetReadDeadline(t time.Time) error
SetReadDeadline sets the deadline for future Read calls and any currently-blocked Read call. A zero value for t means Read will not time out.
func (ServerUdpConnection) SetWriteDeadline ¶
func (u ServerUdpConnection) SetWriteDeadline(t time.Time) error
SetWriteDeadline sets the deadline for future Write calls and any currently-blocked Write call. Even if write times out, it may return n > 0, indicating that some of the data was successfully written. A zero value for t means Write will not time out.
type TunnelDialer ¶
type TunnelDialer interface { Dial(network, addr string) (c net.Conn, err error) Protocol() TunnelProtocol }
type TunnelProtocol ¶
type TunnelProtocol string
const ( Tcp TunnelProtocol = "tcp" Tls TunnelProtocol = "tcp" Udp TunnelProtocol = "udp" )
func (TunnelProtocol) String ¶
func (t TunnelProtocol) String() string
type TunnelServer ¶
type TunnelServerCommon ¶
type TunnelServerCommon struct { TunnelServer Server icommon.TunnelInterfaceServer Listener net.Listener // contains filtered or unexported fields }
func (TunnelServerCommon) Close ¶
func (s TunnelServerCommon) Close() error
func (TunnelServerCommon) Closed ¶
func (s TunnelServerCommon) Closed() bool
func (TunnelServerCommon) HandleConnection ¶
func (s TunnelServerCommon) HandleConnection(conn net.Conn)
func (TunnelServerCommon) SetServer ¶
func (s TunnelServerCommon) SetServer(ss icommon.TunnelInterfaceServer)
func (TunnelServerCommon) WaitingForConnection ¶
func (s TunnelServerCommon) WaitingForConnection()