trojan

package
v0.0.0-...-96f04ba Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const HeaderLen = 56

HeaderLen is ...

Variables

This section is empty.

Functions

func ParseURL

func ParseURL(s string) (server, path, password, transport, mux, domain string, err error)

ParseURL is ...

func WriteAddr

func WriteAddr(conn net.Conn, cmd byte, tgt net.Addr) error

WriteAddr is ...

func WriteHeaderAddr

func WriteHeaderAddr(conn net.Conn, header []byte, cmd byte, tgt net.Addr) error

WriteHeaderAddr is ...

Types

type Dialer

type Dialer interface {
	Dial(byte, net.Addr) (net.Conn, error)
}

Dialer is ...

type Handler

type Handler struct {
	// Dialer is ...
	Dialer Dialer
	// Addr is ...
	Addr string
	// contains filtered or unexported fields
}

Handler is ...

func NewHandler

func NewHandler(s string, timeout time.Duration) (*Handler, error)

NewHandler is ...

func (*Handler) Close

func (h *Handler) Close() error

Close is ...

func (*Handler) Handle

func (h *Handler) Handle(conn net.Conn, tgt net.Addr) error

Handle is ...

func (*Handler) HandlePacket

func (h *Handler) HandlePacket(conn gonet.PacketConn) error

HandlePacket is ...

type MuxDialer

type MuxDialer struct {
	// Dialer is ...
	Dialer Dialer
	// Ticker is ...
	Ticker *time.Ticker
	// Config is ...
	Config smux.Config
	// MaxConn is ...
	MaxConn int
	// EmptyAddr is ...
	EmptyAddr [1 + 1 + 4 + 2 + 2]byte
	// contains filtered or unexported fields
}

MuxDialer is ...

func (*MuxDialer) Close

func (d *MuxDialer) Close() error

Close is ...

func (*MuxDialer) Configure

func (dialer *MuxDialer) Configure(d Dialer, ver int) *MuxDialer

Configure is ...

func (*MuxDialer) Dial

func (d *MuxDialer) Dial(cmd byte, addr net.Addr) (net.Conn, error)

Dial is ...

type NetDialer

type NetDialer struct {
	// Dialer is ...
	Dialer net.Dialer
	// Addr is ...
	Addr string
}

NetDialer is ...

func (*NetDialer) Dial

func (d *NetDialer) Dial(network, addr string) (net.Conn, error)

Dial is ...

func (*NetDialer) DialContext

func (d *NetDialer) DialContext(ctx context.Context, network, addr string) (net.Conn, error)

DialContext is ...

type TLSDialer

type TLSDialer struct {
	// Addr is ...
	Addr string
	// Config is ...
	Config tls.Config
	// Header is ...
	Header [HeaderLen + 2]byte
}

TLSDialer is ...

func (*TLSDialer) Dial

func (d *TLSDialer) Dial(cmd byte, addr net.Addr) (net.Conn, error)

Dial is ...

type WebSocketDialer

type WebSocketDialer struct {
	// Addr is ...
	Addr string
	// NetDialer is ...
	NetDialer NetDialer
	// Dialer is ...
	Dialer websocket.Dialer
	// Header is ...
	Header [HeaderLen + 2]byte
}

WebSocketDialer is ...

func (*WebSocketDialer) Dial

func (d *WebSocketDialer) Dial(cmd byte, addr net.Addr) (net.Conn, error)

Dial is ...

Jump to

Keyboard shortcuts

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