shadowsocks

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: GPL-2.0 Imports: 11 Imported by: 0

README

sing-shadowsocks

Lightweight and efficient shadowsocks implementation with sing.

Documentation

Index

Constants

View Source
const MethodNone = "none"

Variables

View Source
var (
	ErrBadKey          = E.New("bad key")
	ErrMissingPassword = E.New("missing password")
	ErrNoUsers         = E.New("no users")
)

Functions

func Key

func Key(password []byte, keySize int) []byte

Types

type Handler

type Handler interface {
	N.TCPConnectionHandler
	N.UDPConnectionHandler
	E.Handler
}

type Method

type Method interface {
	Name() string
	DialConn(conn net.Conn, destination M.Socksaddr) (net.Conn, error)
	DialEarlyConn(conn net.Conn, destination M.Socksaddr) net.Conn
	DialPacketConn(conn net.Conn) N.NetPacketConn
}

func NewNone

func NewNone() Method

type MultiService

type MultiService[U comparable] interface {
	Name() string
	UpdateUsers(userList []U, keyList [][]byte) error
	UpdateUsersWithPasswords(userList []U, passwordList []string) error
	N.TCPConnectionHandler
	N.UDPHandler
	E.Handler
}

type NoneMethod

type NoneMethod struct{}

func (*NoneMethod) DialConn

func (m *NoneMethod) DialConn(conn net.Conn, destination M.Socksaddr) (net.Conn, error)

func (*NoneMethod) DialEarlyConn

func (m *NoneMethod) DialEarlyConn(conn net.Conn, destination M.Socksaddr) net.Conn

func (*NoneMethod) DialPacketConn

func (m *NoneMethod) DialPacketConn(conn net.Conn) N.NetPacketConn

func (*NoneMethod) Name

func (m *NoneMethod) Name() string

type NoneService

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

func (*NoneService) Name

func (s *NoneService) Name() string

func (*NoneService) NewConnection

func (s *NoneService) NewConnection(ctx context.Context, conn net.Conn, metadata M.Metadata) error

func (*NoneService) NewError

func (s *NoneService) NewError(ctx context.Context, err error)

func (*NoneService) NewPacket

func (s *NoneService) NewPacket(ctx context.Context, conn N.PacketConn, buffer *buf.Buffer, metadata M.Metadata) error

func (*NoneService) Password

func (s *NoneService) Password() string

func (*NoneService) WriteIsThreadUnsafe

func (s *NoneService) WriteIsThreadUnsafe()

type ServerConnError

type ServerConnError struct {
	net.Conn
	Source M.Socksaddr
	Cause  error
}

func (*ServerConnError) Close

func (e *ServerConnError) Close() error

func (*ServerConnError) Error

func (e *ServerConnError) Error() string

func (*ServerConnError) Unwrap

func (e *ServerConnError) Unwrap() error

type ServerPacketError

type ServerPacketError struct {
	Source M.Socksaddr
	Cause  error
}

func (*ServerPacketError) Error

func (e *ServerPacketError) Error() string

func (*ServerPacketError) Unwrap

func (e *ServerPacketError) Unwrap() error

type Service

type Service interface {
	Name() string
	Password() string
	N.TCPConnectionHandler
	N.UDPHandler
	E.Handler
}

func NewNoneService

func NewNoneService(udpTimeout int64, handler Handler) Service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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