tun2socks

package
v0.0.0-...-4cf4c4f Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 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 OutlineTunnel

type OutlineTunnel interface {
	outline.Tunnel
}

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

func ConnectShadowsocksTunnel

func ConnectShadowsocksTunnel(fd int, host string, port int, password, cipher string, isUDPEnabled bool, tk string, tcp_website string, udp_dns string) (OutlineTunnel, error)

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

`fd` is the TUN device. The OutlineTunnel acquires an additional reference to it, which

is released by OutlineTunnel.Disconnect(), so the caller must close `fd` _and_ call
Disconnect() in order to close the TUN device.

`host` is IP address of the Shadowsocks proxy server. `port` is the port of the Shadowsocks proxy server. `password` is the password of the Shadowsocks proxy. `cipher` is the encryption cipher the Shadowsocks proxy. `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