@@ -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) {
630631type 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 {
0 commit comments