trojan

package
v0.0.0-...-45a9176 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandTCP byte = 1
	CommandUDP byte = 3
)

Variables

This section is empty.

Functions

func ReadPacket

func ReadPacket(r io.Reader, payload []byte) (net.Addr, int, int, error)

func WritePacket

func WritePacket(w io.Writer, socks5Addr, payload []byte) (int, error)

Types

type Command

type Command = byte

type Option

type Option struct {
	Password          string
	ALPN              []string
	ServerName        string
	SkipCertVerify    bool
	Fingerprint       string
	Flow              string
	FlowShow          bool
	ClientFingerprint string
}

type PacketConn

type PacketConn struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*PacketConn) ReadFrom

func (pc *PacketConn) ReadFrom(b []byte) (int, net.Addr, error)

func (*PacketConn) WriteTo

func (pc *PacketConn) WriteTo(b []byte, addr net.Addr) (int, error)

type Trojan

type Trojan struct {
	// contains filtered or unexported fields
}

func New

func New(option *Option) *Trojan

func (*Trojan) PacketConn

func (t *Trojan) PacketConn(conn net.Conn) net.PacketConn

func (*Trojan) PresetXTLSConn

func (t *Trojan) PresetXTLSConn(conn net.Conn) (net.Conn, error)

func (*Trojan) StreamConn

func (t *Trojan) StreamConn(conn net.Conn) (net.Conn, error)

func (*Trojan) StreamWebsocketConn

func (t *Trojan) StreamWebsocketConn(conn net.Conn, wsOptions *WebsocketOption) (net.Conn, error)

func (*Trojan) WriteHeader

func (t *Trojan) WriteHeader(w io.Writer, command Command, socks5Addr []byte) error

type WebsocketOption

type WebsocketOption struct {
	Host    string
	Port    string
	Path    string
	Headers http.Header
}

Jump to

Keyboard shortcuts

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