Documentation
¶
Index ¶
- Variables
- type ActiveTimeConn
- type ActiveTimeHyUDPConn
- type Config
- type HyPacketConn
- func (c *HyPacketConn) Close() error
- func (c *HyPacketConn) LocalAddr() net.Addr
- func (c *HyPacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)
- func (c *HyPacketConn) SetDeadline(t time.Time) error
- func (c *HyPacketConn) SetReadDeadline(t time.Time) error
- func (c *HyPacketConn) SetWriteDeadline(t time.Time) error
- func (c *HyPacketConn) WriteTo(p []byte, addr net.Addr) (n int, err error)
- type HyUdpConnToNetConn
- func (c *HyUdpConnToNetConn) Close() error
- func (c *HyUdpConnToNetConn) LocalAddr() net.Addr
- func (c *HyUdpConnToNetConn) Read(p []byte) (n int, err error)
- func (c *HyUdpConnToNetConn) RemoteAddr() net.Addr
- func (c *HyUdpConnToNetConn) SetDeadline(t time.Time) error
- func (c *HyUdpConnToNetConn) SetReadDeadline(t time.Time) error
- func (c *HyUdpConnToNetConn) SetWriteDeadline(t time.Time) error
- func (c *HyUdpConnToNetConn) Write(p []byte) (int, error)
- type HysClient
- func (d *HysClient) HandleFlow(ctx context.Context, dst net.Destination, rw buf.ReaderWriter) error
- func (d *HysClient) HandlePacketConn(ctx context.Context, dst net.Destination, p udp.PacketReaderWriter) error
- func (d *HysClient) ListenPacket(ctx context.Context, dst net.Destination) (udp.UdpConn, error)
- func (d *HysClient) ProxyDial(ctx context.Context, dst net.Destination, initialData buf.MultiBuffer) (i.FlowConn, error)
- func (d *HysClient) Tag() string
- type Inbound
- func (in *Inbound) AddUser(user i.User)
- func (in *Inbound) Authenticate(addr net.Addr, auth string, tx uint64) (ok bool, user i.User)
- func (in *Inbound) Close() error
- func (in *Inbound) Connect(addr net.Addr, secret string, tx uint64)
- func (in *Inbound) Disconnect(addr net.Addr, id string, err error)
- func (in *Inbound) LogOnlineState(user i.User, online bool)
- func (in *Inbound) LogTraffic(user i.User, tx, rx uint64) (ok bool)
- func (in *Inbound) RealmStatus() (active bool, realmID string, publicAddrs []string, peers int)
- func (in *Inbound) RemoveUser(user i.User)
- func (in *Inbound) Start() error
- func (in *Inbound) TCPError(addr net.Addr, id, reqAddr string, err error)
- func (in *Inbound) TCPRequest(addr net.Addr, id, reqAddr string)
- func (in *Inbound) Tag() string
- func (in *Inbound) TraceStream(stream server.HyStream, stats *server.StreamStats)
- func (in *Inbound) UDPError(addr net.Addr, id string, sessionID uint32, err error)
- func (in *Inbound) UDPRequest(addr net.Addr, id string, sessionID uint32, reqAddr string)
- func (in *Inbound) UntraceStream(stream server.HyStream)
- func (in *Inbound) WithOnUnauthorizedRequest(f i.UnauthorizedReport)
- type InboundConfig
- type RealmConfig
- type RealmPortMappingConfig
Constants ¶
This section is empty.
Variables ¶
var ErrRejectQuic = errors.New("reject quic over hysteria2")
Functions ¶
This section is empty.
Types ¶
type ActiveTimeConn ¶
type ActiveTimeHyUDPConn ¶
type Config ¶
type Config struct {
Tag string
PacketListener i.PacketListener
Dialer i.Dialer
HysteriaClientConfig *client.Config
SalamanderPassword string
Address net.Address
PortSelector i.PortSelector
IpResolverForNodeAddress i.IPResolver
DomainStrategy domain.DomainStrategy
RejectQuic bool
Realm RealmConfig
}
type HyPacketConn ¶
type HyPacketConn struct {
// contains filtered or unexported fields
}
Adapter for client.HyUDPConn to implement net.PacketConn
func (*HyPacketConn) LocalAddr ¶
func (c *HyPacketConn) LocalAddr() net.Addr
LocalAddr implements net.PacketConn
func (*HyPacketConn) SetDeadline ¶
func (c *HyPacketConn) SetDeadline(t time.Time) error
SetDeadline implements net.PacketConn
func (*HyPacketConn) SetReadDeadline ¶
func (c *HyPacketConn) SetReadDeadline(t time.Time) error
SetReadDeadline implements net.PacketConn
func (*HyPacketConn) SetWriteDeadline ¶
func (c *HyPacketConn) SetWriteDeadline(t time.Time) error
SetWriteDeadline implements net.PacketConn
type HyUdpConnToNetConn ¶
type HyUdpConnToNetConn struct {
// contains filtered or unexported fields
}
func (*HyUdpConnToNetConn) Close ¶
func (c *HyUdpConnToNetConn) Close() error
func (*HyUdpConnToNetConn) LocalAddr ¶
func (c *HyUdpConnToNetConn) LocalAddr() net.Addr
func (*HyUdpConnToNetConn) RemoteAddr ¶
func (c *HyUdpConnToNetConn) RemoteAddr() net.Addr
func (*HyUdpConnToNetConn) SetDeadline ¶
func (c *HyUdpConnToNetConn) SetDeadline(t time.Time) error
func (*HyUdpConnToNetConn) SetReadDeadline ¶
func (c *HyUdpConnToNetConn) SetReadDeadline(t time.Time) error
func (*HyUdpConnToNetConn) SetWriteDeadline ¶
func (c *HyUdpConnToNetConn) SetWriteDeadline(t time.Time) error
type HysClient ¶
type HysClient struct {
IpResolverForNodeAddress i.IPResolver
IpResolverForTargetAddress i.IPResolver
DomainStrategy domain.DomainStrategy
RejectQuic bool
sync.Mutex
// contains filtered or unexported fields
}
func (*HysClient) HandleFlow ¶
func (d *HysClient) HandleFlow(ctx context.Context, dst net.Destination, rw buf.ReaderWriter) error
func (*HysClient) HandlePacketConn ¶
func (d *HysClient) HandlePacketConn(ctx context.Context, dst net.Destination, p udp.PacketReaderWriter) error
func (*HysClient) ListenPacket ¶
type Inbound ¶ added in v1.4.0
type Inbound struct {
// contains filtered or unexported fields
}
func NewInbound ¶ added in v1.4.0
func NewInbound(config *InboundConfig) (*Inbound, error)
func (*Inbound) Authenticate ¶ added in v1.4.0
func (*Inbound) Disconnect ¶ added in v1.4.0
func (*Inbound) LogOnlineState ¶ added in v1.4.0
func (*Inbound) LogTraffic ¶ added in v1.4.0
rx is what received from final dest, and the data will be sent back to client. tx is the data sent to the final dest, in other words, the data received from the client data sent back to client is rx, data received from client is tx send(to client) traffic meter happens at the transport layer, so we don't need to count it here
func (*Inbound) RealmStatus ¶ added in v1.4.0
RealmStatus returns a snapshot of the realm server state. active is false when no realm server is running (realmRuntime is nil or session is empty). peers counts authenticated QUIC clients that connected via a successful realm STUN punch.
func (*Inbound) RemoveUser ¶ added in v1.4.0
func (*Inbound) TCPRequest ¶ added in v1.4.0
func (*Inbound) TraceStream ¶ added in v1.4.0
func (in *Inbound) TraceStream(stream server.HyStream, stats *server.StreamStats)
func (*Inbound) UDPRequest ¶ added in v1.4.0
func (*Inbound) UntraceStream ¶ added in v1.4.0
func (*Inbound) WithOnUnauthorizedRequest ¶ added in v1.4.0
func (in *Inbound) WithOnUnauthorizedRequest(f i.UnauthorizedReport)
type InboundConfig ¶ added in v1.4.0
type InboundConfig struct {
*configs.Hysteria2ServerConfig
Addresses []string
Ports []uint16
Tag string
Handler i.Handler
Listener i.PacketListener
Realm RealmConfig
StatsUser bool
}