tun2socks

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IntraTunnel added in v1.1.0

type IntraTunnel interface {
	tunnel.Tunnel
}

IntraTunnel embeds the tun2socks.Tunnel interface so it gets exported by gobind. Intra does not need any methods beyond the basic Tunnel interface.

func ConnectIntraTunnel added in v1.1.0

func ConnectIntraTunnel(fd int, fakedns, udpdns, tcpdns string, listener tunnel.IntraListener) (IntraTunnel, error)

ConnectIntraTunnel reads packets from a TUN device and applies the Intra routing rules. Currently, this only consists of redirecting DNS packets to a specified server; all other data flows directly to its destination.

`fakedns` is the DNS server that the system believes it is using, in "host:port" style.

The port is normally 53.

`udpdns` and `tcpdns` are the location of the actual DNS server being used. For DNS

tunneling in Intra, these are typically high-numbered ports on localhost.

Throws an exception if the TUN file descriptor cannot be opened, or if the tunnel fails to connect.

type OutlineTunnel added in v1.1.0

type OutlineTunnel interface {
	tunnel.OutlineTunnel
}

OutlineTunnel embeds the tun2socks.OutlineTunnel interface so it gets exported by gobind.

func ConnectSocksTunnel

func ConnectSocksTunnel(fd int, host string, port int, isUDPEnabled bool) (OutlineTunnel, error)

ConnectSocksTunnel reads packets from a TUN device and routes it to a SOCKS server. Returns an AndroidTunnel instance and does *not* take ownership of the TUN file descriptor; the caller is responsible for closing after AndroidTunnel disconnects.

`fd` is the file descriptor to the VPN TUN device. Must be set to blocking mode. `host` is IP address of the SOCKS proxy server. `port` is the port of the SOCKS proxy server. `isUDPEnabled` indicates whether the tunnel and/or network enable UDP proxying.

Throws an exception if the TUN file descriptor cannot be opened, or if the tunnel fails to connect.

Jump to

Keyboard shortcuts

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