Documentation ¶
Index ¶
- Constants
- func NewXPlusPacketConn(conn net.PacketConn, key []byte) net.PacketConn
- func StringToBps(s string) uint64
- func WriteClientHello(stream io.Writer, hello ClientHello) error
- func WriteClientRequest(stream io.Writer, request ClientRequest) error
- func WriteServerHello(stream io.Writer, hello ServerHello) error
- func WriteServerResponse(stream io.Writer, response ServerResponse) error
- func WriteUDPMessage(conn quic.Connection, message UDPMessage) error
- type BrutalSender
- func (b *BrutalSender) CanSend(bytesInFlight congestion.ByteCount) bool
- func (b *BrutalSender) GetCongestionWindow() congestion.ByteCount
- func (b *BrutalSender) HasPacingBudget(now time.Time) bool
- func (b *BrutalSender) InRecovery() bool
- func (b *BrutalSender) InSlowStart() bool
- func (b *BrutalSender) MaybeExitSlowStart()
- func (b *BrutalSender) OnPacketAcked(number congestion.PacketNumber, ackedBytes congestion.ByteCount, ...)
- func (b *BrutalSender) OnPacketLost(number congestion.PacketNumber, lostBytes congestion.ByteCount, ...)
- func (b *BrutalSender) OnPacketSent(sentTime time.Time, bytesInFlight congestion.ByteCount, ...)
- func (b *BrutalSender) OnRetransmissionTimeout(packetsRetransmitted bool)
- func (b *BrutalSender) SetMaxDatagramSize(size congestion.ByteCount)
- func (b *BrutalSender) SetRTTStatsProvider(rttStats congestion.RTTStatsProvider)
- func (b *BrutalSender) TimeUntilSend(bytesInFlight congestion.ByteCount) time.Time
- type ClientHello
- type ClientRequest
- type Conn
- type Defragger
- type PacketConn
- func (c *PacketConn) Close() error
- func (c *PacketConn) Hold()
- func (c *PacketConn) LocalAddr() net.Addr
- func (c *PacketConn) NeedAdditionalReadDeadline() bool
- func (c *PacketConn) Read(b []byte) (n int, err error)
- func (c *PacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)
- func (c *PacketConn) ReadPacket(buffer *buf.Buffer) (destination M.Socksaddr, err error)
- func (c *PacketConn) ReadPacketThreadSafe() (buffer *buf.Buffer, destination M.Socksaddr, err error)
- func (c *PacketConn) RemoteAddr() net.Addr
- func (c *PacketConn) SetDeadline(t time.Time) error
- func (c *PacketConn) SetReadDeadline(t time.Time) error
- func (c *PacketConn) SetWriteDeadline(t time.Time) error
- func (c *PacketConn) Write(b []byte) (n int, err error)
- func (c *PacketConn) WritePacket(buffer *buf.Buffer, destination M.Socksaddr) error
- func (c *PacketConn) WriteTo(p []byte, addr net.Addr) (n int, err error)
- type PacketConnWrapper
- type ServerHello
- type ServerResponse
- type StreamWrapper
- type UDPMessage
- type VectorisedXPlusConn
- type XPlusPacketConn
Constants ¶
View Source
const ( MbpsToBps = 125000 MinSpeedBPS = 16384 DefaultStreamReceiveWindow = 15728640 // 15 MB/s DefaultConnectionReceiveWindow = 67108864 // 64 MB/s DefaultMaxIncomingStreams = 1024 DefaultALPN = "hysteria" KeepAlivePeriod = 10 * time.Second )
View Source
const Version = 3
Variables ¶
This section is empty.
Functions ¶
func NewXPlusPacketConn ¶
func NewXPlusPacketConn(conn net.PacketConn, key []byte) net.PacketConn
func StringToBps ¶
func WriteClientHello ¶
func WriteClientHello(stream io.Writer, hello ClientHello) error
func WriteClientRequest ¶
func WriteClientRequest(stream io.Writer, request ClientRequest) error
func WriteServerHello ¶
func WriteServerHello(stream io.Writer, hello ServerHello) error
func WriteServerResponse ¶
func WriteServerResponse(stream io.Writer, response ServerResponse) error
func WriteUDPMessage ¶
func WriteUDPMessage(conn quic.Connection, message UDPMessage) error
Types ¶
type BrutalSender ¶
type BrutalSender struct {
// contains filtered or unexported fields
}
func NewBrutalSender ¶
func NewBrutalSender(bps congestion.ByteCount) *BrutalSender
func (*BrutalSender) CanSend ¶
func (b *BrutalSender) CanSend(bytesInFlight congestion.ByteCount) bool
func (*BrutalSender) GetCongestionWindow ¶
func (b *BrutalSender) GetCongestionWindow() congestion.ByteCount
func (*BrutalSender) HasPacingBudget ¶
func (b *BrutalSender) HasPacingBudget(now time.Time) bool
func (*BrutalSender) InRecovery ¶
func (b *BrutalSender) InRecovery() bool
func (*BrutalSender) InSlowStart ¶
func (b *BrutalSender) InSlowStart() bool
func (*BrutalSender) MaybeExitSlowStart ¶
func (b *BrutalSender) MaybeExitSlowStart()
func (*BrutalSender) OnPacketAcked ¶
func (b *BrutalSender) OnPacketAcked(number congestion.PacketNumber, ackedBytes congestion.ByteCount, priorInFlight congestion.ByteCount, eventTime time.Time, )
func (*BrutalSender) OnPacketLost ¶
func (b *BrutalSender) OnPacketLost(number congestion.PacketNumber, lostBytes congestion.ByteCount, priorInFlight congestion.ByteCount, )
func (*BrutalSender) OnPacketSent ¶
func (b *BrutalSender) OnPacketSent(sentTime time.Time, bytesInFlight congestion.ByteCount, packetNumber congestion.PacketNumber, bytes congestion.ByteCount, isRetransmittable bool, )
func (*BrutalSender) OnRetransmissionTimeout ¶
func (b *BrutalSender) OnRetransmissionTimeout(packetsRetransmitted bool)
func (*BrutalSender) SetMaxDatagramSize ¶
func (b *BrutalSender) SetMaxDatagramSize(size congestion.ByteCount)
func (*BrutalSender) SetRTTStatsProvider ¶
func (b *BrutalSender) SetRTTStatsProvider(rttStats congestion.RTTStatsProvider)
func (*BrutalSender) TimeUntilSend ¶
func (b *BrutalSender) TimeUntilSend(bytesInFlight congestion.ByteCount) time.Time
type ClientHello ¶
func ReadClientHello ¶
func ReadClientHello(reader io.Reader) (*ClientHello, error)
type ClientRequest ¶
func ReadClientRequest ¶
func ReadClientRequest(stream io.Reader) (*ClientRequest, error)
type Conn ¶
type Conn struct { quic.Stream // contains filtered or unexported fields }
func (*Conn) ReaderReplaceable ¶
func (*Conn) RemoteAddr ¶
func (*Conn) WriterReplaceable ¶
type Defragger ¶
type Defragger struct {
// contains filtered or unexported fields
}
func (*Defragger) Feed ¶
func (d *Defragger) Feed(m UDPMessage) *UDPMessage
type PacketConn ¶
type PacketConn struct {
// contains filtered or unexported fields
}
func NewPacketConn ¶
func NewPacketConn(session quic.Connection, stream quic.Stream, sessionId uint32, destination M.Socksaddr, msgCh <-chan *UDPMessage, closer io.Closer) *PacketConn
func (*PacketConn) Close ¶
func (c *PacketConn) Close() error
func (*PacketConn) Hold ¶
func (c *PacketConn) Hold()
func (*PacketConn) LocalAddr ¶
func (c *PacketConn) LocalAddr() net.Addr
func (*PacketConn) NeedAdditionalReadDeadline ¶ added in v1.2.5
func (c *PacketConn) NeedAdditionalReadDeadline() bool
func (*PacketConn) ReadPacket ¶
func (*PacketConn) ReadPacketThreadSafe ¶
func (*PacketConn) RemoteAddr ¶
func (c *PacketConn) RemoteAddr() net.Addr
func (*PacketConn) SetDeadline ¶
func (c *PacketConn) SetDeadline(t time.Time) error
func (*PacketConn) SetReadDeadline ¶
func (c *PacketConn) SetReadDeadline(t time.Time) error
func (*PacketConn) SetWriteDeadline ¶
func (c *PacketConn) SetWriteDeadline(t time.Time) error
func (*PacketConn) WritePacket ¶
type PacketConnWrapper ¶
type PacketConnWrapper struct {
net.PacketConn
}
func (*PacketConnWrapper) SetReadBuffer ¶
func (c *PacketConnWrapper) SetReadBuffer(bytes int) error
func (*PacketConnWrapper) SetWriteBuffer ¶
func (c *PacketConnWrapper) SetWriteBuffer(bytes int) error
func (*PacketConnWrapper) SyscallConn ¶
func (c *PacketConnWrapper) SyscallConn() (syscall.RawConn, error)
func (*PacketConnWrapper) Upstream ¶
func (c *PacketConnWrapper) Upstream() any
type ServerHello ¶
func ReadServerHello ¶
func ReadServerHello(stream io.Reader) (*ServerHello, error)
type ServerResponse ¶
func ReadServerResponse ¶
func ReadServerResponse(stream io.Reader) (*ServerResponse, error)
type StreamWrapper ¶
type StreamWrapper struct { Conn quic.Connection quic.Stream }
func (*StreamWrapper) Close ¶
func (s *StreamWrapper) Close() error
func (*StreamWrapper) LocalAddr ¶
func (s *StreamWrapper) LocalAddr() net.Addr
func (*StreamWrapper) RemoteAddr ¶
func (s *StreamWrapper) RemoteAddr() net.Addr
func (*StreamWrapper) Upstream ¶
func (s *StreamWrapper) Upstream() any
type UDPMessage ¶
type UDPMessage struct { SessionID uint32 Host string Port uint16 MsgID uint16 // doesn't matter when not fragmented, but must not be 0 when fragmented FragID uint8 // doesn't matter when not fragmented, starts at 0 when fragmented FragCount uint8 // must be 1 when not fragmented Data []byte }
func FragUDPMessage ¶
func FragUDPMessage(m UDPMessage, maxSize int) []UDPMessage
func ParseUDPMessage ¶
func ParseUDPMessage(packet []byte) (message UDPMessage, err error)
func (UDPMessage) HeaderSize ¶
func (m UDPMessage) HeaderSize() int
func (UDPMessage) Size ¶
func (m UDPMessage) Size() int
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.