Skip to content

Commit 3f608b3

Browse files
authored
Finalmask quicParams: Add bbrProfile ("conservative" / "standard" (default) / "aggressive") (#5869)
And Update github.com/apernet/quic-go to 20260330051153
1 parent 4c3020c commit 3f608b3

12 files changed

Lines changed: 408 additions & 101 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/xtls/xray-core
33
go 1.26
44

55
require (
6-
github.com/apernet/quic-go v0.59.1-0.20260217092621-db4786c77a22
6+
github.com/apernet/quic-go v0.59.1-0.20260330051153-c402ee641eb6
77
github.com/cloudflare/circl v1.6.3
88
github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344
99
github.com/golang/mock v1.7.0-rc.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
github.com/andybalholm/brotli v1.0.6 h1:Yf9fFpf49Zrxb9NlQaluyE92/+X7UVHlhMNJN2sxfOI=
22
github.com/andybalholm/brotli v1.0.6/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
3-
github.com/apernet/quic-go v0.59.1-0.20260217092621-db4786c77a22 h1:00ziBGnLWQEcR9LThDwvxOznJJquJ9bYUdmBFnawLMU=
4-
github.com/apernet/quic-go v0.59.1-0.20260217092621-db4786c77a22/go.mod h1:Npbg8qBtAZlsAB3FWmqwlVh5jtVG6a4DlYsOylUpvzA=
3+
github.com/apernet/quic-go v0.59.1-0.20260330051153-c402ee641eb6 h1:cbF95uMsQwCwAzH2i8+2lNO2TReoELLuqeeMfyBjFbY=
4+
github.com/apernet/quic-go v0.59.1-0.20260330051153-c402ee641eb6/go.mod h1:Npbg8qBtAZlsAB3FWmqwlVh5jtVG6a4DlYsOylUpvzA=
55
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
66
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
77
github.com/cloudflare/circl v1.6.3 h1:9GPOhQGF9MCYUeXyMYlqTR6a5gTrgR/fBLXvUgtVcg8=

infra/conf/transport_internet.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import (
3636
"github.com/xtls/xray-core/transport/internet/finalmask/xicmp"
3737
"github.com/xtls/xray-core/transport/internet/httpupgrade"
3838
"github.com/xtls/xray-core/transport/internet/hysteria"
39+
"github.com/xtls/xray-core/transport/internet/hysteria/congestion/bbr"
3940
"github.com/xtls/xray-core/transport/internet/kcp"
4041
"github.com/xtls/xray-core/transport/internet/reality"
4142
"github.com/xtls/xray-core/transport/internet/splithttp"
@@ -630,6 +631,7 @@ func (c *TLSCertConfig) Build() (*tls.Certificate, error) {
630631
type QuicParamsConfig struct {
631632
Congestion string `json:"congestion"`
632633
Debug bool `json:"debug"`
634+
BbrProfile string `json:"bbrProfile"`
633635
BrutalUp Bandwidth `json:"brutalUp"`
634636
BrutalDown Bandwidth `json:"brutalDown"`
635637
UdpHop UdpHop `json:"udpHop"`
@@ -1894,6 +1896,16 @@ func (c *StreamConfig) Build() (*internet.StreamConfig, error) {
18941896
config.Udpmasks = append(config.Udpmasks, serial.ToTypedMessage(u))
18951897
}
18961898
if c.FinalMask.QuicParams != nil {
1899+
profile := strings.ToLower(c.FinalMask.QuicParams.BbrProfile)
1900+
switch profile {
1901+
case "", string(bbr.ProfileConservative), string(bbr.ProfileStandard), string(bbr.ProfileAggressive):
1902+
if profile == "" {
1903+
profile = string(bbr.ProfileStandard)
1904+
}
1905+
default:
1906+
return nil, errors.New("unknown bbr profile")
1907+
}
1908+
18971909
up, err := c.FinalMask.QuicParams.BrutalUp.Bps()
18981910
if err != nil {
18991911
return nil, err
@@ -1965,6 +1977,7 @@ func (c *StreamConfig) Build() (*internet.StreamConfig, error) {
19651977

19661978
config.QuicParams = &internet.QuicParams{
19671979
Congestion: c.FinalMask.QuicParams.Congestion,
1980+
BbrProfile: profile,
19681981
BrutalUp: up,
19691982
BrutalDown: down,
19701983
UdpHop: &internet.UdpHop{

transport/internet/config.pb.go

Lines changed: 35 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

transport/internet/config.proto

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,18 @@ message UdpHop {
7272

7373
message QuicParams {
7474
string congestion = 1;
75-
uint64 brutal_up = 2;
76-
uint64 brutal_down = 3;
77-
UdpHop udp_hop = 4;
78-
uint64 init_stream_receive_window = 5;
79-
uint64 max_stream_receive_window = 6;
80-
uint64 init_conn_receive_window = 7;
81-
uint64 max_conn_receive_window = 8;
82-
int64 max_idle_timeout = 9;
83-
int64 keep_alive_period = 10;
84-
bool disable_path_mtu_discovery = 11;
85-
int64 max_incoming_streams = 12;
75+
string bbr_profile = 2;
76+
uint64 brutal_up = 3;
77+
uint64 brutal_down = 4;
78+
UdpHop udp_hop = 5;
79+
uint64 init_stream_receive_window = 6;
80+
uint64 max_stream_receive_window = 7;
81+
uint64 init_conn_receive_window = 8;
82+
uint64 max_conn_receive_window = 9;
83+
int64 max_idle_timeout = 10;
84+
int64 keep_alive_period = 11;
85+
bool disable_path_mtu_discovery = 12;
86+
int64 max_incoming_streams = 13;
8687
}
8788

8889
message ProxyConfig {

0 commit comments

Comments
 (0)