Documentation ¶
Index ¶
- Constants
- func NewXPlusPacketConn(conn net.PacketConn, key []byte, disableVectorised bool) net.PacketConn
- func WriteClientHello(stream io.Writer, hello ClientHello) error
- func WriteClientRequest(request ClientRequest, payload []byte) *buf.Buffer
- func WriteServerHello(stream io.Writer, hello ServerHello) error
- func WriteServerResponse(stream quic.Stream, response ServerResponse) error
- type Client
- type ClientHello
- type ClientOptions
- type ClientRequest
- type ServerHandler
- type ServerHello
- type ServerResponse
- type Service
- type ServiceOptions
- type VectorisedXPlusConn
- type XPlusPacketConn
Constants ¶
View Source
const ( MbpsToBps = 125000 MinSpeedBPS = 16384 DefaultALPN = "hysteria" DefaultStreamReceiveWindow = 8388608 // 8MB DefaultConnReceiveWindow = DefaultStreamReceiveWindow * 5 / 2 // 20MB DefaultMaxIdleTimeout = 30 * time.Second DefaultKeepAlivePeriod = 10 * time.Second )
View Source
const ( ProtocolVersion = 3 ProtocolTimeout = 10 * time.Second ErrorCodeGeneric = 0 ErrorCodeProtocolError = 1 ErrorCodeAuthError = 2 )
Variables ¶
This section is empty.
Functions ¶
func NewXPlusPacketConn ¶
func NewXPlusPacketConn(conn net.PacketConn, key []byte, disableVectorised bool) net.PacketConn
func WriteClientHello ¶
func WriteClientHello(stream io.Writer, hello ClientHello) error
func WriteClientRequest ¶
func WriteClientRequest(request ClientRequest, payload []byte) *buf.Buffer
func WriteServerHello ¶
func WriteServerHello(stream io.Writer, hello ServerHello) error
func WriteServerResponse ¶
func WriteServerResponse(stream quic.Stream, response ServerResponse) error
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(options ClientOptions) (*Client, error)
func (*Client) CloseWithError ¶
func (*Client) ListenPacket ¶
type ClientHello ¶
func ReadClientHello ¶
func ReadClientHello(reader io.Reader) (*ClientHello, error)
type ClientOptions ¶
type ClientOptions struct { Context context.Context Dialer N.Dialer Logger logger.Logger BrutalDebug bool ServerAddress M.Socksaddr SendBPS uint64 ReceiveBPS uint64 XPlusPassword string Password string TLSConfig aTLS.Config UDPDisabled bool HopPorts string HopInterval int ConnReceiveWindow uint64 StreamReceiveWindow uint64 DisableMTUDiscovery bool }
type ClientRequest ¶
func ReadClientRequest ¶
func ReadClientRequest(stream io.Reader) (*ClientRequest, error)
type ServerHandler ¶
type ServerHandler interface { N.TCPConnectionHandler N.UDPConnectionHandler }
type ServerHello ¶
func ReadServerHello ¶
func ReadServerHello(stream io.Reader) (*ServerHello, error)
type ServerResponse ¶
func ReadServerResponse ¶
func ReadServerResponse(stream io.Reader) (*ServerResponse, error)
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]) UpdateUsers ¶
type ServiceOptions ¶
type ServiceOptions struct { Context context.Context Logger logger.Logger BrutalDebug bool SendBPS uint64 ReceiveBPS uint64 XPlusPassword string TLSConfig aTLS.ServerConfig UDPDisabled bool UDPTimeout time.Duration Handler ServerHandler ConnReceiveWindow uint64 StreamReceiveWindow uint64 MaxIncomingStreams int64 DisableMTUDiscovery bool }
type VectorisedXPlusConn ¶
type VectorisedXPlusConn struct { XPlusPacketConn // contains filtered or unexported fields }
func (*VectorisedXPlusConn) WriteVectorisedPacket ¶
type XPlusPacketConn ¶
type XPlusPacketConn struct { net.PacketConn // contains filtered or unexported fields }
func (*XPlusPacketConn) Upstream ¶
func (c *XPlusPacketConn) Upstream() any
Source Files ¶
Click to show internal directories.
Click to hide internal directories.