trojan

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: GPL-3.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTrojanDialer

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

NewTrojanDialer returns a trojan proxy dialer.

Types

type PktConn

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

PktConn .

func NewPktConn

func NewPktConn(c net.Conn, tgtAddr 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, net.Addr, error)

DialUDP connects to the given address via the proxy.

Jump to

Keyboard shortcuts

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