Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IntraListener ¶
type IntraListener interface { intra.UDPListener intra.TCPListener }
type OutlineTunnel ¶
type OutlineTunnel interface { Tunnel // SetUDPEnabled indicates whether the tunnel and/or the network support UDP traffic. SetUDPEnabled(isUDPEnabled bool) }
Tunnel represents a tunnel from a TUN device to a server.
func NewTunnel ¶
func NewTunnel(host string, port uint16, isUDPEnabled bool, tunWriter io.WriteCloser) (OutlineTunnel, 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.
type Tunnel ¶
type Tunnel interface { // IsConnected indicates whether the tunnel is in a connected state. IsConnected() bool // Disconnect disconnects the tunnel. Disconnect() // Write writes input data to the TUN interface. Write(data []byte) (int, error) }
Tunnel represents a session on a TUN device.
func NewIntraTunnel ¶
func NewIntraTunnel(fakedns, udpdns, tcpdns string, tunWriter io.WriteCloser, listener IntraListener) (Tunnel, error)
NewIntraTunnel creates a connected Intra session.
`fakedns` is the DNS server (IP and port) that will be used by apps on the TUN device.
This will normally be a reserved or remote IP address, port 53.
`udpdns` and `tcpdns` are the actual location of the DNS server in use.
These will normally be localhost with a high-numbered port.