Add QUIC support for naiveproxy

This commit is contained in:
世界
2025-12-18 17:08:36 +08:00
parent 0585f6d065
commit 48b7adde7d
15 changed files with 553 additions and 199 deletions

View File

@@ -160,7 +160,21 @@ func NewOutbound(ctx context.Context, router adapter.Router, logger log.ContextL
echConfigList = block.Bytes
}
}
var quicCongestionControl cronet.QUICCongestionControl
switch options.QUICCongestionControl {
case "":
quicCongestionControl = cronet.QUICCongestionControlDefault
case "bbr":
quicCongestionControl = cronet.QUICCongestionControlBBR
case "bbr2":
quicCongestionControl = cronet.QUICCongestionControlBBRv2
case "cubic":
quicCongestionControl = cronet.QUICCongestionControlCubic
case "reno":
quicCongestionControl = cronet.QUICCongestionControlReno
default:
return nil, E.New("unknown quic congestion control: ", options.QUICCongestionControl)
}
client, err := cronet.NewNaiveClient(cronet.NaiveClientConfig{
Context: ctx,
ServerAddress: serverAddress,
@@ -176,11 +190,12 @@ func NewOutbound(ctx context.Context, router adapter.Router, logger log.ContextL
ECHEnabled: echEnabled,
ECHConfigList: echConfigList,
ECHQueryServerName: echQueryServerName,
QUIC: options.QUIC,
QUICCongestionControl: quicCongestionControl,
})
if err != nil {
return nil, err
}
var uotClient *uot.Client
uotOptions := common.PtrValueOrDefault(options.UDPOverTCP)
if uotOptions.Enabled {