trojan

package
v0.3.1-beta.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxPacketSize = 1024 * 8
)

Variables

This section is empty.

Functions

func NewClient added in v0.3.3

func NewClient(config *node.PointProtocol_Trojan) node.WrapProxy

Types

type Client

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

modified from https://github.com/p4gefau1t/trojan-go/blob/master/tunnel/trojan/client.go

func (*Client) Conn

func (c *Client) Conn(addr string) (net.Conn, error)

func (*Client) PacketConn

func (c *Client) PacketConn(addr string) (net.PacketConn, error)

type Command

type Command byte
const (
	Connect   Command = 1 // TCP
	Associate Command = 3 // UDP
	Mux       Command = 0x7f
)

type OutboundConn

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

func (*OutboundConn) Write

func (c *OutboundConn) Write(p []byte) (int, error)

func (*OutboundConn) WriteHeader

func (c *OutboundConn) WriteHeader() (err error)

type PacketConn

type PacketConn struct {
	net.Conn
}

func (*PacketConn) ReadFrom

func (c *PacketConn) ReadFrom(payload []byte) (int, net.Addr, error)

func (*PacketConn) WriteTo

func (c *PacketConn) WriteTo(payload []byte, addr net.Addr) (int, error)

Jump to

Keyboard shortcuts

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