trojan

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

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
	ClientSessionCache tls.ClientSessionCache
}

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

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

func (*Trojan) WriteHeader

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

Jump to

Keyboard shortcuts

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