hysteria2

package
v0.0.0-...-ab51429 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: GPL-2.0 Imports: 34 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) 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
	ServerAddress      M.Socksaddr
	SendBPS            uint64
	ReceiveBPS         uint64
	SalamanderPassword string
	Password           string
	TLSConfig          tls.Config
	UDPDisabled        bool
}

type Salamander

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

func (*Salamander) ReadFrom

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

func (*Salamander) WriteTo

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

type Server

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

func NewServer

func NewServer(options ServerOptions) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) Start

func (s *Server) Start(conn net.PacketConn) error

type ServerHandler

type ServerHandler interface {
	N.TCPConnectionHandler
	N.UDPConnectionHandler
}

type ServerOptions

type ServerOptions struct {
	Context               context.Context
	Logger                logger.Logger
	SendBPS               uint64
	ReceiveBPS            uint64
	IgnoreClientBandwidth bool
	SalamanderPassword    string
	TLSConfig             tls.ServerConfig
	Users                 []User
	UDPDisabled           bool
	Handler               ServerHandler
	MasqueradeHandler     http.Handler
}

type User

type User struct {
	Name     string
	Password string
}

type VectorisedSalamander

type VectorisedSalamander struct {
	Salamander
	// contains filtered or unexported fields
}

func (*VectorisedSalamander) WriteTo

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

func (*VectorisedSalamander) WriteVectorisedPacket

func (s *VectorisedSalamander) 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