tun2socks

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL