transport

package
Version: v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(targetAddr string, dialAddr func(domain string) (proxyAddr string, password []byte)) (net.Conn, error)

Dial dial targetAddr with possiable proxy address

func IsSocks5Schema

func IsSocks5Schema(addr string) (string, bool)

func ParseProxyConn added in v0.7.4

func ParseProxyConn(conn net.Conn, password []byte) (net.Conn, string)

func ParseSocks5 added in v0.7.6

func ParseSocks5(conn net.Conn) (tgtaddr string, err error)

func SetDNS added in v0.7.4

func SetDNS(err error, dnsIP string)

func ToProxyConn

func ToProxyConn(conn net.Conn, tgtHost string, tgtPort uint16, password []byte) (net.Conn, error)

func ToSocks5

func ToSocks5(c net.Conn, host string, port uint16) (net.Conn, error)

func ToTrojanConn added in v0.7.6

func ToTrojanConn(conn net.Conn, tgtHost string, tgtPort uint16, password []byte) (net.Conn, error)

Types

type Trojan added in v0.7.6

type Trojan struct {
	Password [56]byte
	TrojanRequest
}

func ParseTrojanConn added in v0.7.6

func ParseTrojanConn(conn net.Conn, password []byte) (net.Conn, *Trojan)

type TrojanRequest added in v0.7.6

type TrojanRequest struct {
	CMD     uint8
	ATYP    uint8
	DstAddr []byte
	DstPort uint16
}

func (*TrojanRequest) Addr added in v0.7.6

func (t *TrojanRequest) Addr() string

Jump to

Keyboard shortcuts

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