mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-06-09 05:49:54 +00:00
chore: reduce udp buffer sizes to 4k & pipe buffer size to 32k
This commit is contained in:
parent
0119024392
commit
a5985c5b6f
@ -17,7 +17,7 @@ import (
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
const udpBufferSize = 65535
|
||||
const udpBufferSize = 4096
|
||||
|
||||
type serverClient struct {
|
||||
CC quic.Connection
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
"github.com/HyNetwork/hysteria/pkg/core"
|
||||
)
|
||||
|
||||
const udpBufferSize = 65535
|
||||
const udpBufferSize = 4096
|
||||
|
||||
var ErrTimeout = errors.New("inactivity timeout")
|
||||
|
||||
|
@ -19,7 +19,7 @@ import (
|
||||
"github.com/txthinking/socks5"
|
||||
)
|
||||
|
||||
const udpBufferSize = 65535
|
||||
const udpBufferSize = 4096
|
||||
|
||||
var (
|
||||
ErrUnsupportedCmd = errors.New("unsupported command")
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
"github.com/LiamHaworth/go-tproxy"
|
||||
)
|
||||
|
||||
const udpBufferSize = 65535
|
||||
const udpBufferSize = 4096
|
||||
|
||||
type UDPTProxy struct {
|
||||
HyClient *core.Client
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
"github.com/HyNetwork/hysteria/pkg/transport/pktconns/obfs"
|
||||
)
|
||||
|
||||
const udpBufferSize = 65535
|
||||
const udpBufferSize = 4096
|
||||
|
||||
type ObfsFakeTCPPacketConn struct {
|
||||
orig *TCPConn
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
"github.com/HyNetwork/hysteria/pkg/transport/pktconns/obfs"
|
||||
)
|
||||
|
||||
const udpBufferSize = 65535
|
||||
const udpBufferSize = 4096
|
||||
|
||||
type ObfsUDPPacketConn struct {
|
||||
orig *net.UDPConn
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
|
||||
const (
|
||||
packetQueueSize = 1024
|
||||
udpBufferSize = 2048
|
||||
udpBufferSize = 4096
|
||||
)
|
||||
|
||||
// parseAddr parses the listen address and returns the host and ports.
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
"github.com/HyNetwork/hysteria/pkg/transport/pktconns/obfs"
|
||||
)
|
||||
|
||||
const udpBufferSize = 65535
|
||||
const udpBufferSize = 4096
|
||||
|
||||
// ObfsWeChatUDPPacketConn is still a UDP packet conn, but it adds WeChat video call header to each packet.
|
||||
// Obfs in this case can be nil
|
||||
|
@ -13,7 +13,7 @@ import (
|
||||
"github.com/xjasonlyu/tun2socks/v2/core/adapter"
|
||||
)
|
||||
|
||||
const udpBufferSize = 65535
|
||||
const udpBufferSize = 4096
|
||||
|
||||
func (s *Server) HandleUDP(conn adapter.UDPConn) {
|
||||
go s.handleUDPConn(conn)
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const PipeBufferSize = 65535
|
||||
const PipeBufferSize = 32 * 1024
|
||||
|
||||
func Pipe(src, dst io.ReadWriter, count func(int)) error {
|
||||
buf := make([]byte, PipeBufferSize)
|
||||
|
Loading…
x
Reference in New Issue
Block a user