shadowsocks

package
v0.0.0-...-e25560c Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCipherNotSupported = errors.New("cipher not supported")

ErrCipherNotSupported occurs when a cipher is not supported (likely because of security concerns).

Functions

func AESGCM

func AESGCM(psk []byte) (cipherCreateFunc, error)

AESGCM creates a new Cipher with a pre-shared key. len(psk) must be one of 16, 24, or 32 to select AES-128/196/256-GCM.

func Chacha20Poly1305

func Chacha20Poly1305(psk []byte) (cipherCreateFunc, error)

Chacha20Poly1305 creates a new Cipher with a pre-shared key. len(psk) must be 32.

Types

type PacketShadowsocks

type PacketShadowsocks struct {
	Shadowsocks
	net.PacketConn
	// contains filtered or unexported fields
}

func (*PacketShadowsocks) Metadata

func (p *PacketShadowsocks) Metadata() *message.Metadata

func (*PacketShadowsocks) ReadMsgFrom

func (p *PacketShadowsocks) ReadMsgFrom() (message.Message, net.Addr, error)

func (*PacketShadowsocks) WriteMsgTo

func (p *PacketShadowsocks) WriteMsgTo(msg message.Message, addr net.Addr) error

type Shadowsocks

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

func NewProxyShadowsocks

func NewProxyShadowsocks(mode int, password, cipher, key string, udp bool) (*Shadowsocks, error)

func (*Shadowsocks) Cipher

func (s *Shadowsocks) Cipher() proxy.Cipher

func (*Shadowsocks) ShadowPacketConn

func (s *Shadowsocks) ShadowPacketConn(c net.PacketConn, extra ...any) (conn.ProxyPacketConn, error)

func (*Shadowsocks) ShadowStreamConn

func (s *Shadowsocks) ShadowStreamConn(c net.Conn, extra ...any) (conn.ProxyStreamConn, error)

func (*Shadowsocks) TcpMux

func (s *Shadowsocks) TcpMux() bool

func (*Shadowsocks) Type

func (s *Shadowsocks) Type() proxy.ProxyType

type StreamShadowsocks

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

func (*StreamShadowsocks) Metadata

func (s *StreamShadowsocks) Metadata() *message.Metadata

func (*StreamShadowsocks) Read

func (s *StreamShadowsocks) Read(b []byte) (int, error)

func (*StreamShadowsocks) ReadMux

func (s *StreamShadowsocks) ReadMux() (message.Message, error)

func (*StreamShadowsocks) Write

func (s *StreamShadowsocks) Write(b []byte) (int, error)

func (*StreamShadowsocks) WriteMux

func (s *StreamShadowsocks) WriteMux(msg message.Message) error

Jump to

Keyboard shortcuts

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