mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-06-17 17:59:53 +00:00
commit
349ac5e41e
@ -67,7 +67,7 @@ func client(config *clientConfig) {
|
|||||||
InitialConnectionReceiveWindow: config.ReceiveWindow,
|
InitialConnectionReceiveWindow: config.ReceiveWindow,
|
||||||
MaxConnectionReceiveWindow: config.ReceiveWindow,
|
MaxConnectionReceiveWindow: config.ReceiveWindow,
|
||||||
KeepAlive: true,
|
KeepAlive: true,
|
||||||
DisablePathMTUDiscovery: config.DisableMTUDiscovery,
|
DisablePathMTUDiscovery: true, // Ref: https://github.com/lucas-clemente/quic-go/issues/3327
|
||||||
EnableDatagrams: true,
|
EnableDatagrams: true,
|
||||||
}
|
}
|
||||||
if config.ReceiveWindowConn == 0 {
|
if config.ReceiveWindowConn == 0 {
|
||||||
|
@ -49,7 +49,6 @@ type serverConfig struct {
|
|||||||
ReceiveWindowConn uint64 `json:"recv_window_conn"`
|
ReceiveWindowConn uint64 `json:"recv_window_conn"`
|
||||||
ReceiveWindowClient uint64 `json:"recv_window_client"`
|
ReceiveWindowClient uint64 `json:"recv_window_client"`
|
||||||
MaxConnClient int `json:"max_conn_client"`
|
MaxConnClient int `json:"max_conn_client"`
|
||||||
DisableMTUDiscovery bool `json:"disable_mtu_discovery"`
|
|
||||||
IPv6Only bool `json:"ipv6_only"`
|
IPv6Only bool `json:"ipv6_only"`
|
||||||
Resolver string `json:"resolver"`
|
Resolver string `json:"resolver"`
|
||||||
}
|
}
|
||||||
@ -139,19 +138,18 @@ type clientConfig struct {
|
|||||||
Listen string `json:"listen"`
|
Listen string `json:"listen"`
|
||||||
Timeout int `json:"timeout"`
|
Timeout int `json:"timeout"`
|
||||||
} `json:"tproxy_udp"`
|
} `json:"tproxy_udp"`
|
||||||
ACL string `json:"acl"`
|
ACL string `json:"acl"`
|
||||||
MMDB string `json:"mmdb"`
|
MMDB string `json:"mmdb"`
|
||||||
Obfs string `json:"obfs"`
|
Obfs string `json:"obfs"`
|
||||||
Auth []byte `json:"auth"`
|
Auth []byte `json:"auth"`
|
||||||
AuthString string `json:"auth_str"`
|
AuthString string `json:"auth_str"`
|
||||||
ALPN string `json:"alpn"`
|
ALPN string `json:"alpn"`
|
||||||
ServerName string `json:"server_name"`
|
ServerName string `json:"server_name"`
|
||||||
Insecure bool `json:"insecure"`
|
Insecure bool `json:"insecure"`
|
||||||
CustomCA string `json:"ca"`
|
CustomCA string `json:"ca"`
|
||||||
ReceiveWindowConn uint64 `json:"recv_window_conn"`
|
ReceiveWindowConn uint64 `json:"recv_window_conn"`
|
||||||
ReceiveWindow uint64 `json:"recv_window"`
|
ReceiveWindow uint64 `json:"recv_window"`
|
||||||
DisableMTUDiscovery bool `json:"disable_mtu_discovery"`
|
Resolver string `json:"resolver"`
|
||||||
Resolver string `json:"resolver"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *clientConfig) Check() error {
|
func (c *clientConfig) Check() error {
|
||||||
|
@ -70,7 +70,7 @@ func server(config *serverConfig) {
|
|||||||
MaxConnectionReceiveWindow: config.ReceiveWindowClient,
|
MaxConnectionReceiveWindow: config.ReceiveWindowClient,
|
||||||
MaxIncomingStreams: int64(config.MaxConnClient),
|
MaxIncomingStreams: int64(config.MaxConnClient),
|
||||||
KeepAlive: true,
|
KeepAlive: true,
|
||||||
DisablePathMTUDiscovery: config.DisableMTUDiscovery,
|
DisablePathMTUDiscovery: true, // Ref: https://github.com/lucas-clemente/quic-go/issues/3327
|
||||||
EnableDatagrams: true,
|
EnableDatagrams: true,
|
||||||
}
|
}
|
||||||
if config.ReceiveWindowConn == 0 {
|
if config.ReceiveWindowConn == 0 {
|
||||||
|
@ -6,6 +6,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
initMaxDatagramSize = 1252
|
||||||
|
|
||||||
pktInfoSlotCount = 4
|
pktInfoSlotCount = 4
|
||||||
minSampleCount = 50
|
minSampleCount = 50
|
||||||
minAckRate = 0.75
|
minAckRate = 0.75
|
||||||
@ -28,7 +30,8 @@ type pktInfo struct {
|
|||||||
|
|
||||||
func NewBrutalSender(bps congestion.ByteCount) *BrutalSender {
|
func NewBrutalSender(bps congestion.ByteCount) *BrutalSender {
|
||||||
bs := &BrutalSender{
|
bs := &BrutalSender{
|
||||||
bps: bps,
|
bps: bps,
|
||||||
|
maxDatagramSize: initMaxDatagramSize,
|
||||||
}
|
}
|
||||||
bs.pacer = newPacer(func() congestion.ByteCount {
|
bs.pacer = newPacer(func() congestion.ByteCount {
|
||||||
return congestion.ByteCount(float64(bs.bps) / bs.getAckRate())
|
return congestion.ByteCount(float64(bs.bps) / bs.getAckRate())
|
||||||
|
@ -7,9 +7,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
initMaxDatagramSize = 1252
|
maxBurstPackets = 10
|
||||||
maxBurstPackets = 10
|
minPacingDelay = time.Millisecond
|
||||||
minPacingDelay = time.Millisecond
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// The pacer implements a token bucket pacing algorithm.
|
// The pacer implements a token bucket pacing algorithm.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user