trojan

package
v0.0.0-...-be81314 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CmdConnect is ...
	CmdConnect = 1
	// CmdAssociate is ...
	CmdAssociate = 3
)
View Source
const HeaderLen = 56

HeaderLen is ...

Variables

This section is empty.

Functions

func GenKey

func GenKey(s string, key []byte)

GenKey is ...

func Handle

func Handle(r io.Reader, w io.Writer) (int64, int64, error)

Handle is ...

func HandleTCP

func HandleTCP(r io.Reader, w io.Writer, addr net.Addr, d Dialer) (int64, int64, error)

HandleTCP is ... trojan TCP stream

func HandleUDP

func HandleUDP(r io.Reader, w io.Writer, timeout time.Duration, d Dialer) (int64, int64, error)

HandleUDP is ... [AddrType(1 byte)][Addr(max 256 byte)][Port(2 byte)][Len(2 byte)][0x0d, 0x0a][Data(max 65535 byte)]

func HandleWithDialer

func HandleWithDialer(r io.Reader, w io.Writer, d Dialer) (int64, int64, error)

HandleWithDialer is ...

Types

type Dialer

type Dialer interface {
	// Dial is ...
	Dial(string, string) (net.Conn, error)
	// ListenPacket is ...
	ListenPacket(string, string) (net.PacketConn, error)
}

Dialer is ...

Jump to

Keyboard shortcuts

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