Documentation ¶
Index ¶
- Constants
- Variables
- func CheckHyClientHealthy(client hyClient.Client) bool
- func CloseHyClient(dest net.Destination, streamSettings *internet.MemoryStreamConfig) error
- func Dial(ctx context.Context, dest net.Destination, ...) (internet.Connection, error)
- func GetClientTLSConfig(dest net.Destination, streamSettings *internet.MemoryStreamConfig) (*hyClient.TLSConfig, error)
- func GetHyClient(dest net.Destination, streamSettings *internet.MemoryStreamConfig) (hyClient.Client, error)
- func GetServerTLSConfig(streamSettings *internet.MemoryStreamConfig) (*hyServer.TLSConfig, error)
- func Listen(ctx context.Context, address net.Address, port net.Port, ...) (internet.Listener, error)
- func NewHyClient(dest net.Destination, streamSettings *internet.MemoryStreamConfig) (hyClient.Client, error)
- func ResolveAddress(dest net.Destination) (net.Addr, error)
- type Authenticator
- type Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (x *Config) GetCongestion() *Congestion
- func (x *Config) GetIgnoreClientBandwidth() bool
- func (x *Config) GetPassword() string
- func (x *Config) GetUseUdpExtension() bool
- func (*Config) ProtoMessage()
- func (x *Config) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (x *Config) String() string
- type Congestion
- func (*Congestion) Descriptor() ([]byte, []int)deprecated
- func (x *Congestion) GetDownMbps() uint64
- func (x *Congestion) GetType() string
- func (x *Congestion) GetUpMbps() uint64
- func (*Congestion) ProtoMessage()
- func (x *Congestion) ProtoReflect() protoreflect.Message
- func (x *Congestion) Reset()
- func (x *Congestion) String() string
- type HyConn
- func (c *HyConn) Close() error
- func (c *HyConn) LocalAddr() net.Addr
- func (c *HyConn) Read(b []byte) (int, error)
- func (c *HyConn) ReadPacket() (int, []byte, *net.Destination, error)
- func (c *HyConn) RemoteAddr() net.Addr
- func (c *HyConn) SetDeadline(t time.Time) error
- func (c *HyConn) SetReadDeadline(t time.Time) error
- func (c *HyConn) SetWriteDeadline(t time.Time) error
- func (c *HyConn) Write(b []byte) (int, error)
- func (c *HyConn) WritePacket(b []byte, dest net.Destination) (int, error)
- type Listener
Constants ¶
View Source
const CanNotUseUdpExtension = "Only hysteria2 proxy protocol can use udpExtension."
View Source
const Hy2MustNeedTLS = "Hysteria2 based on QUIC that requires TLS."
Variables ¶
View Source
var ClientMutex sync.Mutex
View Source
var File_transport_internet_hysteria2_config_proto protoreflect.FileDescriptor
View Source
var MBps uint64 = 1000000 / 8 // MByte
View Source
var RunningClient map[dialerConf](hyClient.Client)
Functions ¶
func CheckHyClientHealthy ¶
func CloseHyClient ¶
func CloseHyClient(dest net.Destination, streamSettings *internet.MemoryStreamConfig) error
func Dial ¶
func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.MemoryStreamConfig) (internet.Connection, error)
func GetClientTLSConfig ¶
func GetClientTLSConfig(dest net.Destination, streamSettings *internet.MemoryStreamConfig) (*hyClient.TLSConfig, error)
func GetHyClient ¶
func GetHyClient(dest net.Destination, streamSettings *internet.MemoryStreamConfig) (hyClient.Client, error)
func GetServerTLSConfig ¶
func GetServerTLSConfig(streamSettings *internet.MemoryStreamConfig) (*hyServer.TLSConfig, error)
func Listen ¶
func Listen(ctx context.Context, address net.Address, port net.Port, streamSettings *internet.MemoryStreamConfig, handler internet.ConnHandler) (internet.Listener, error)
Listen creates a new Listener based on configurations.
func NewHyClient ¶
func NewHyClient(dest net.Destination, streamSettings *internet.MemoryStreamConfig) (hyClient.Client, error)
func ResolveAddress ¶
func ResolveAddress(dest net.Destination) (net.Addr, error)
Types ¶
type Authenticator ¶
type Authenticator struct {
Password string
}
func (*Authenticator) Authenticate ¶
type Config ¶
type Config struct { Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` Congestion *Congestion `protobuf:"bytes,4,opt,name=congestion,proto3" json:"congestion,omitempty"` IgnoreClientBandwidth bool `` /* 127-byte string literal not displayed */ UseUdpExtension bool `protobuf:"varint,6,opt,name=use_udp_extension,json=useUdpExtension,proto3" json:"use_udp_extension,omitempty"` // contains filtered or unexported fields }
func (*Config) Descriptor
deprecated
func (*Config) GetCongestion ¶
func (x *Config) GetCongestion() *Congestion
func (*Config) GetIgnoreClientBandwidth ¶
func (*Config) GetPassword ¶
func (*Config) GetUseUdpExtension ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
type Congestion ¶
type Congestion struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` UpMbps uint64 `protobuf:"varint,2,opt,name=up_mbps,json=upMbps,proto3" json:"up_mbps,omitempty"` DownMbps uint64 `protobuf:"varint,3,opt,name=down_mbps,json=downMbps,proto3" json:"down_mbps,omitempty"` // contains filtered or unexported fields }
func (*Congestion) Descriptor
deprecated
func (*Congestion) Descriptor() ([]byte, []int)
Deprecated: Use Congestion.ProtoReflect.Descriptor instead.
func (*Congestion) GetDownMbps ¶
func (x *Congestion) GetDownMbps() uint64
func (*Congestion) GetType ¶
func (x *Congestion) GetType() string
func (*Congestion) GetUpMbps ¶
func (x *Congestion) GetUpMbps() uint64
func (*Congestion) ProtoMessage ¶
func (*Congestion) ProtoMessage()
func (*Congestion) ProtoReflect ¶
func (x *Congestion) ProtoReflect() protoreflect.Message
func (*Congestion) Reset ¶
func (x *Congestion) Reset()
func (*Congestion) String ¶
func (x *Congestion) String() string
type HyConn ¶
type HyConn struct { IsUDPExtension bool IsServer bool ClientUDPSession hyClient.HyUDPConn ServerUDPSession *hyServer.UdpSessionEntry // contains filtered or unexported fields }
func (*HyConn) ReadPacket ¶
func (*HyConn) RemoteAddr ¶
func (*HyConn) WritePacket ¶
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener is an internet.Listener that listens for TCP connections.
func (*Listener) StreamHijacker ¶
func (*Listener) UdpHijacker ¶
func (l *Listener) UdpHijacker(entry *hyServer.UdpSessionEntry, originalAddr string)
Click to show internal directories.
Click to hide internal directories.