trojan

package
v0.2.11-4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func GenKey

func GenKey(s string, key []byte)

func HandleTCP

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

func HandleUDP

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

[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)

Types

type Dialer

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

Jump to

Keyboard shortcuts

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