trojanc

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CRLF        = []byte{13, 10}
	FailAuthErr = fmt.Errorf("incorrect password")
)
View Source
var (
	ErrInvalidMetadata = errors.Errorf("invalid metadata")
)

Functions

func MetadataTypeToByte

func MetadataTypeToByte(typ protocol.MetadataType) byte

func NetworkToByte

func NetworkToByte(network string) byte

func NewDialer

func NewDialer(nextDialer proxy.Dialer, header protocol.Header) (proxy.Dialer, error)

func ParseMetadataType

func ParseMetadataType(t byte) protocol.MetadataType

func ParseNetwork

func ParseNetwork(n byte) string

func SealUDP

func SealUDP(metadata Metadata, dst []byte, data []byte) []byte

Types

type Conn

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

func NewConn

func NewConn(conn net.Conn, metadata Metadata, password string) (c *Conn, err error)

func (*Conn) LocalAddr

func (c *Conn) LocalAddr() net.Addr

func (*Conn) Read

func (c *Conn) Read(b []byte) (n int, err error)

func (*Conn) ReadFrom

func (c *Conn) ReadFrom(p []byte) (n int, addr net.Addr, err error)

func (*Conn) ReadReqHeader

func (c *Conn) ReadReqHeader() (err error)

func (*Conn) RemoteAddr

func (c *Conn) RemoteAddr() net.Addr

func (*Conn) Write

func (c *Conn) Write(b []byte) (n int, err error)

func (*Conn) WriteTo

func (c *Conn) WriteTo(p []byte, addr net.Addr) (n int, err error)

type Dialer

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

func (*Dialer) Dial

func (d *Dialer) Dial(network string, addr string) (c net.Conn, err error)

type Metadata

type Metadata struct {
	protocol.Metadata
	Network string
}

func (*Metadata) Len

func (m *Metadata) Len() int

func (*Metadata) PackTo

func (m *Metadata) PackTo(dst []byte) (n int)

func (*Metadata) Unpack

func (m *Metadata) Unpack(src []byte) (n int)

Jump to

Keyboard shortcuts

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