hysteria2

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: GPL-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const ObfsTypeSalamander = "salamander"

Variables

This section is empty.

Functions

func NewSalamanderConn

func NewSalamanderConn(conn net.PacketConn, password []byte, disableVectorised bool) net.PacketConn

Types

type Client

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

func NewClient

func NewClient(options ClientOptions) (*Client, error)

func (*Client) CloseWithError

func (c *Client) CloseWithError(err error) error

func (*Client) DialConn

func (c *Client) DialConn(ctx context.Context, destination M.Socksaddr) (net.Conn, error)

func (*Client) ListenPacket

func (c *Client) ListenPacket(ctx context.Context) (net.PacketConn, error)

type ClientOptions

type ClientOptions struct {
	Context            context.Context
	Dialer             N.Dialer
	Logger             logger.Logger
	BrutalDebug        bool
	ServerAddress      M.Socksaddr
	SendBPS            uint64
	ReceiveBPS         uint64
	SalamanderPassword string
	Password           string
	TLSConfig          aTLS.Config
	UDPDisabled        bool
	HopPorts           string
	HopInterval        int
}

type SalamanderPacketConn

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

func (*SalamanderPacketConn) ReadFrom

func (s *SalamanderPacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)

func (*SalamanderPacketConn) WriteTo

func (s *SalamanderPacketConn) WriteTo(p []byte, addr net.Addr) (n int, err error)

type ServerHandler

type ServerHandler interface {
	N.TCPConnectionHandler
	N.UDPConnectionHandler
}

type Service

type Service[U comparable] struct {
	// contains filtered or unexported fields
}

func NewService

func NewService[U comparable](options ServiceOptions) (*Service[U], error)

func (*Service[U]) Close

func (s *Service[U]) Close() error

func (*Service[U]) Start

func (s *Service[U]) Start(conn net.PacketConn) error

func (*Service[U]) UpdateUsers

func (s *Service[U]) UpdateUsers(userList []U, passwordList []string)

type ServiceOptions

type ServiceOptions struct {
	Context               context.Context
	Logger                logger.Logger
	BrutalDebug           bool
	SendBPS               uint64
	ReceiveBPS            uint64
	IgnoreClientBandwidth bool
	SalamanderPassword    string
	TLSConfig             aTLS.ServerConfig
	UDPDisabled           bool
	UDPTimeout            time.Duration
	Handler               ServerHandler
	MasqueradeHandler     http.Handler
}

type VectorisedSalamanderPacketConn

type VectorisedSalamanderPacketConn struct {
	SalamanderPacketConn
	// contains filtered or unexported fields
}

func (*VectorisedSalamanderPacketConn) WriteTo

func (s *VectorisedSalamanderPacketConn) WriteTo(p []byte, addr net.Addr) (n int, err error)

func (*VectorisedSalamanderPacketConn) WriteVectorisedPacket

func (s *VectorisedSalamanderPacketConn) WriteVectorisedPacket(buffers []*buf.Buffer, destination M.Socksaddr) error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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