diff --git a/listener/parse.go b/listener/parse.go index 9459b9e1..aa9e39ac 100644 --- a/listener/parse.go +++ b/listener/parse.go @@ -92,6 +92,7 @@ func ParseListener(mapping map[string]any) (C.InboundListener, error) { AuthenticationTimeout: 1000, ALPN: []string{"h3"}, MaxUdpRelayPacketSize: 1500, + CongestionController: "bbr", } err = decoder.Decode(mapping, tuicOption) if err != nil { diff --git a/transport/tuic/server.go b/transport/tuic/server.go index 3f459fd6..77d99322 100644 --- a/transport/tuic/server.go +++ b/transport/tuic/server.go @@ -73,6 +73,7 @@ func (s *Server) Close() error { } type serverHandler struct { + serverOption ServerOption *Server quicConn quic.Connection uuid uuid.UUID @@ -166,7 +167,7 @@ func (s *serverHandler) handleStream() (err error) { if err != nil { return err } - + SetCongestionController(s.quicConn, s.CongestionController) go func() (err error) { stream := &quicStreamConn{ Stream: quicStream, @@ -214,6 +215,7 @@ func (s *serverHandler) handleUniStream() (err error) { if err != nil { return err } + SetCongestionController(s.quicConn, s.CongestionController) go func() (err error) { defer func() { stream.CancelRead(0)