juicity

package
v0.0.0-...-e5d0cd3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnderlaySaltLen = 32
)
View Source
const (
	Version0 byte = 0x0
)

Variables

View Source
var (
	CipherConf = ciphers.AeadCiphersConf["chacha20-poly1305"]
)

Functions

func NewDialer

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

func SealUDP

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

Types

type ClientOption

type ClientOption struct {
	TlsConfig            *tls.Config
	QuicConfig           *quic.Config
	Uuid                 [16]byte
	Password             string
	CongestionController string
	CWND                 int
	Ctx                  context.Context
	Cancel               func()
	UnderlayAuth         chan *UnderlayAuth
}

type Conn

type Conn struct {
	quic.Stream
	Metadata *trojanc.Metadata
	// contains filtered or unexported fields
}

func NewConn

func NewConn(stream quic.Stream, mdata *trojanc.Metadata, closeDeferFn func()) *Conn

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) CloseWrite

func (c *Conn) CloseWrite() error

func (*Conn) Read

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

func (*Conn) Write

func (c *Conn) Write(b []byte) (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 netproxy.Conn, err error)

func (*Dialer) DialCmdMsg

func (d *Dialer) DialCmdMsg(cmd protocol.MetadataCmd) (c netproxy.Conn, err error)

func (*Dialer) DialTcp

func (d *Dialer) DialTcp(addr string) (c netproxy.Conn, err error)

func (*Dialer) DialUdp

func (d *Dialer) DialUdp(addr string) (c netproxy.PacketConn, err error)

type PacketConn

type PacketConn struct {
	*Conn
	// contains filtered or unexported fields
}

func (*PacketConn) Close

func (c *PacketConn) Close() error

func (*PacketConn) Read

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

func (*PacketConn) ReadFrom

func (c *PacketConn) ReadFrom(p []byte) (n int, addrPort netip.AddrPort, err error)

func (*PacketConn) Write

func (c *PacketConn) Write(b []byte) (int, error)

func (*PacketConn) WriteTo

func (c *PacketConn) WriteTo(p []byte, addr string) (n int, err error)

type TransportPacketConn

type TransportPacketConn struct {
	*quic.Transport
	// contains filtered or unexported fields
}

func (*TransportPacketConn) Close

func (c *TransportPacketConn) Close() error

func (*TransportPacketConn) Read

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

func (*TransportPacketConn) ReadFrom

func (c *TransportPacketConn) ReadFrom(p []byte) (n int, addrPort netip.AddrPort, err error)

func (*TransportPacketConn) SetDeadline

func (c *TransportPacketConn) SetDeadline(t time.Time) error

SetDeadline implements netproxy.Conn.

func (*TransportPacketConn) SetReadDeadline

func (c *TransportPacketConn) SetReadDeadline(t time.Time) error

SetReadDeadline implements netproxy.Conn.

func (*TransportPacketConn) SetWriteDeadline

func (c *TransportPacketConn) SetWriteDeadline(t time.Time) error

SetWriteDeadline implements netproxy.Conn.

func (*TransportPacketConn) Write

func (c *TransportPacketConn) Write(b []byte) (int, error)

func (*TransportPacketConn) WriteTo

func (c *TransportPacketConn) WriteTo(p []byte, addr string) (n int, err error)

type UnderlayAuth

type UnderlayAuth struct {
	IV       []byte
	Psk      []byte
	Metadata *trojanc.Metadata
}

func (*UnderlayAuth) PackFromPool

func (a *UnderlayAuth) PackFromPool() (buf pool.PB)

func (*UnderlayAuth) Unpack

func (a *UnderlayAuth) Unpack(r io.Reader) (n int, err error)

Jump to

Keyboard shortcuts

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