snell

package
v0.0.0-...-8d2645b Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxPoolCap    = 10
	PoolTimeoutMS = 150000
)
View Source
const (
	CommandPing      byte = 0
	CommandConnect   byte = 1
	CommandConnectV2 byte = 5
	CommandUDP       byte = 6

	CommandUDPForward byte = 1

	ResponseTunnel byte = 0
	ResponseReady  byte = 0
	ResponsePong   byte = 1
	ResponseError  byte = 2

	Version byte = 1
)

Variables

This section is empty.

Functions

func NewAppError

func NewAppError(code byte, msg string) error

func WriteHeader

func WriteHeader(conn net.Conn, host string, port uint, v2 bool) error

Types

type AppError

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

func (*AppError) Error

func (e *AppError) Error() string

type SnellClient

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

func NewSnellClient

func NewSnellClient(listen, server, obfs, obfsHost, psk string, isV2 bool) (*SnellClient, error)

func (*SnellClient) Close

func (s *SnellClient) Close()

func (*SnellClient) DropSession

func (s *SnellClient) DropSession(c net.Conn)

func (*SnellClient) GetSession

func (s *SnellClient) GetSession(target string) (net.Conn, error)

func (*SnellClient) PutSession

func (s *SnellClient) PutSession(c net.Conn)

func (*SnellClient) StreamConn

func (s *SnellClient) StreamConn(c net.Conn, target string) (net.Conn, error)

type SnellServer

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

func NewSnellServer

func NewSnellServer(listen, psk, obfsType string) (*SnellServer, error)

func (*SnellServer) Close

func (s *SnellServer) Close()

func (*SnellServer) ServerHandshake

func (s *SnellServer) ServerHandshake(c net.Conn) (target string, cmd byte, err error)

Jump to

Keyboard shortcuts

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