trojan

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: GPL-3.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClearTextDialer added in v0.12.0

func NewClearTextDialer(s string, d proxy.Dialer) (proxy.Dialer, error)

NewClearTextDialer returns a trojan cleartext proxy dialer.

func NewClearTextServer added in v0.12.0

func NewClearTextServer(s string, p proxy.Proxy) (proxy.Server, error)

NewClearTextServer returns a trojan cleartext proxy server.

func NewTrojanDialer

func NewTrojanDialer(s string, d proxy.Dialer) (proxy.Dialer, error)

NewTrojanDialer returns a trojan proxy dialer.

func NewTrojanServer added in v0.12.0

func NewTrojanServer(s string, p proxy.Proxy) (proxy.Server, error)

NewTrojanServer returns a trojan proxy server.

Types

type PktConn

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

PktConn is a udp Packet.Conn.

func NewPktConn

func NewPktConn(c net.Conn, target socks.Addr) *PktConn

NewPktConn returns a PktConn.

func (*PktConn) ReadFrom

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

ReadFrom implements the necessary function of net.PacketConn.

func (*PktConn) WriteTo

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

WriteTo implements the necessary function of net.PacketConn.

type Trojan

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

Trojan is a base trojan struct.

func NewTrojan

func NewTrojan(s string, d proxy.Dialer, p proxy.Proxy) (*Trojan, error)

NewTrojan returns a trojan proxy.

func (*Trojan) Addr

func (s *Trojan) Addr() string

Addr returns forwarder's address.

func (*Trojan) Dial

func (s *Trojan) Dial(network, addr string) (net.Conn, error)

Dial connects to the address addr on the network net via the proxy.

func (*Trojan) DialUDP

func (s *Trojan) DialUDP(network, addr string) (net.PacketConn, error)

DialUDP connects to the given address via the proxy.

func (*Trojan) ListenAndServe added in v0.12.0

func (s *Trojan) ListenAndServe()

ListenAndServe listen and serves connections.

func (*Trojan) Serve added in v0.12.0

func (s *Trojan) Serve(c net.Conn)

Serve serves a connection.

func (*Trojan) ServeUoT added in v0.12.0

func (s *Trojan) ServeUoT(c net.Conn, tgt socks.Addr)

ServeUoT serves udp over tcp requests.

Jump to

Keyboard shortcuts

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