shadowsocks_stream

package
v0.0.0-...-6daa40f Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: AGPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TransportMagicAddr = "<TRANSPORT>"
)

Variables

This section is empty.

Functions

func NewDialer

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

Types

type Dialer

type Dialer struct {
	EncryptMethod   string
	EncryptPassword string
	// contains filtered or unexported fields
}

func (*Dialer) Addr

func (d *Dialer) Addr() string

Addr returns forwarder's address

func (*Dialer) Dial

func (d *Dialer) Dial(network, addr string) (netproxy.Conn, error)

func (*Dialer) DialTcpTransport

func (d *Dialer) DialTcpTransport(magicNetwork string) (netproxy.Conn, error)

func (*Dialer) DialUdpTransport

func (d *Dialer) DialUdpTransport(magicNetwork string) (netproxy.PacketConn, error)

type TcpConn

type TcpConn struct {
	netproxy.Conn
	// contains filtered or unexported fields
}

TcpConn the struct that override the netproxy.Conn methods

func NewTcpConn

func NewTcpConn(c netproxy.Conn, cipher *ciphers.StreamCipher) *TcpConn

func (*TcpConn) Cipher

func (c *TcpConn) Cipher() *ciphers.StreamCipher

func (*TcpConn) Read

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

func (*TcpConn) Write

func (c *TcpConn) Write(b []byte) (n int, err error)

type UdpConn

type UdpConn struct {
	netproxy.PacketConn
	// contains filtered or unexported fields
}

UdpConn the struct that override the netproxy.Conn methods

func NewUdpConn

func NewUdpConn(c netproxy.PacketConn, cipher *ciphers.StreamCipher, defaultAddr socks.Addr, proxyAddr string) *UdpConn

func (*UdpConn) Cipher

func (c *UdpConn) Cipher() *ciphers.StreamCipher

func (*UdpConn) Read

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

func (*UdpConn) ReadFrom

func (c *UdpConn) ReadFrom(b []byte) (n int, from netip.AddrPort, err error)

func (*UdpConn) ReadTransport

func (c *UdpConn) ReadTransport(b []byte) (n int, err error)

func (*UdpConn) Write

func (c *UdpConn) Write(b []byte) (n int, err error)

func (*UdpConn) WriteTo

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

func (*UdpConn) WriteTransport

func (c *UdpConn) WriteTransport(p []byte) (n int, err error)

type UdpTransportConn

type UdpTransportConn struct {
	*UdpConn
}

func (*UdpTransportConn) Read

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

func (*UdpTransportConn) ReadFrom

func (c *UdpTransportConn) ReadFrom(b []byte) (n int, from netip.AddrPort, err error)

func (*UdpTransportConn) Write

func (c *UdpTransportConn) Write(b []byte) (n int, err error)

func (*UdpTransportConn) WriteTo

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

Jump to

Keyboard shortcuts

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