Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tunnel ¶
type Tunnel interface { // IsConnected indicates whether the tunnel is in a connected state. IsConnected() bool // SetUDPEnabled indicates whether the tunnel and/or the network support UDP traffic. SetUDPEnabled(isUDPEnabled bool) // Disconnect disconnects the tunnel. Disconnect() // Write writes input data to the TUN interface. Write(data []byte) (int, error) }
Tunnel represents a tunnel from a TUN device to a server.
func NewTunnel ¶
func NewTunnel(host string, port uint16, isUDPEnabled bool, tunWriter io.WriteCloser) (Tunnel, error)
NewTunnel connects a tunnel to a SOCKS5 server and returns a `Tunnel` object.
`host` is the IP or domain of the SOCKS server. `port` is the port of the SOCKS server. `isUDPEnabled` indicates if the SOCKS server and the network support proxying UDP traffic. `tunWriter` is used to output packets back to the TUN device.
Click to show internal directories.
Click to hide internal directories.