diff --git a/docs/configuration/inbound/hysteria2.md b/docs/configuration/inbound/hysteria2.md index b65304e2..ab6f2e4d 100644 --- a/docs/configuration/inbound/hysteria2.md +++ b/docs/configuration/inbound/hysteria2.md @@ -20,8 +20,9 @@ } ], "ignore_client_bandwidth": false, + "tls": {}, "masquerade": "", - "tls": {} + "brutal_debug": false } ``` @@ -67,6 +68,12 @@ Commands the client to use the BBR flow control algorithm instead of Hysteria CC Conflict with `up_mbps` and `down_mbps`. +#### tls + +==Required== + +TLS configuration, see [TLS](/configuration/shared/tls/#inbound). + #### masquerade HTTP3 server behavior when authentication fails. @@ -78,8 +85,6 @@ HTTP3 server behavior when authentication fails. A 404 page will be returned if empty. -#### tls +#### brutal_debug -==Required== - -TLS configuration, see [TLS](/configuration/shared/tls/#inbound). \ No newline at end of file +Enable debug information logging for Hysteria Brutal CC. diff --git a/docs/configuration/inbound/hysteria2.zh.md b/docs/configuration/inbound/hysteria2.zh.md index 49d2258a..d21a13d0 100644 --- a/docs/configuration/inbound/hysteria2.zh.md +++ b/docs/configuration/inbound/hysteria2.zh.md @@ -20,8 +20,9 @@ } ], "ignore_client_bandwidth": false, + "tls": {}, "masquerade": "", - "tls": {} + "brutal_debug": false } ``` @@ -65,6 +66,12 @@ Hysteria 用户 与 `up_mbps` 和 `down_mbps` 冲突。 +#### tls + +==必填== + +TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。 + #### masquerade HTTP3 服务器认证失败时的行为。 @@ -76,8 +83,6 @@ HTTP3 服务器认证失败时的行为。 如果为空,则返回 404 页。 -#### tls +#### brutal_debug -==必填== - -TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。 \ No newline at end of file +启用 Hysteria Brutal CC 的调试信息日志记录。 diff --git a/docs/configuration/outbound/hysteria2.md b/docs/configuration/outbound/hysteria2.md index 115c1f25..9861e332 100644 --- a/docs/configuration/outbound/hysteria2.md +++ b/docs/configuration/outbound/hysteria2.md @@ -16,6 +16,7 @@ "password": "goofy_ahh_password", "network": "tcp", "tls": {}, + "brutal_debug": false, ... // Dial Fields } @@ -73,6 +74,10 @@ Both is enabled by default. TLS configuration, see [TLS](/configuration/shared/tls/#outbound). +#### brutal_debug + +Enable debug information logging for Hysteria Brutal CC. + ### Dial Fields See [Dial Fields](/configuration/shared/dial) for details. diff --git a/docs/configuration/outbound/hysteria2.zh.md b/docs/configuration/outbound/hysteria2.zh.md index ba699b58..e9d1cb2d 100644 --- a/docs/configuration/outbound/hysteria2.zh.md +++ b/docs/configuration/outbound/hysteria2.zh.md @@ -16,6 +16,7 @@ "password": "goofy_ahh_password", "network": "tcp", "tls": {}, + "brutal_debug": false, ... // 拨号字段 } @@ -73,6 +74,9 @@ QUIC 流量混淆器密码. TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#outbound)。 +#### brutal_debug + +启用 Hysteria Brutal CC 的调试信息日志记录。 ### 拨号字段 diff --git a/inbound/hysteria2.go b/inbound/hysteria2.go index 07b45af2..5db881c3 100644 --- a/inbound/hysteria2.go +++ b/inbound/hysteria2.go @@ -90,6 +90,7 @@ func NewHysteria2(ctx context.Context, router adapter.Router, logger log.Context service, err := hysteria2.NewService[int](hysteria2.ServiceOptions{ Context: ctx, Logger: logger, + BrutalDebug: options.BrutalDebug, SendBPS: uint64(options.UpMbps * hysteria.MbpsToBps), ReceiveBPS: uint64(options.DownMbps * hysteria.MbpsToBps), SalamanderPassword: salamanderPassword, diff --git a/option/hysteria2.go b/option/hysteria2.go index 48396ca1..feab475b 100644 --- a/option/hysteria2.go +++ b/option/hysteria2.go @@ -9,6 +9,7 @@ type Hysteria2InboundOptions struct { IgnoreClientBandwidth bool `json:"ignore_client_bandwidth,omitempty"` TLS *InboundTLSOptions `json:"tls,omitempty"` Masquerade string `json:"masquerade,omitempty"` + BrutalDebug bool `json:"brutal_debug,omitempty"` } type Hysteria2Obfs struct { @@ -24,10 +25,11 @@ type Hysteria2User struct { type Hysteria2OutboundOptions struct { DialerOptions ServerOptions - UpMbps int `json:"up_mbps,omitempty"` - DownMbps int `json:"down_mbps,omitempty"` - Obfs *Hysteria2Obfs `json:"obfs,omitempty"` - Password string `json:"password,omitempty"` - Network NetworkList `json:"network,omitempty"` - TLS *OutboundTLSOptions `json:"tls,omitempty"` + UpMbps int `json:"up_mbps,omitempty"` + DownMbps int `json:"down_mbps,omitempty"` + Obfs *Hysteria2Obfs `json:"obfs,omitempty"` + Password string `json:"password,omitempty"` + Network NetworkList `json:"network,omitempty"` + TLS *OutboundTLSOptions `json:"tls,omitempty"` + BrutalDebug bool `json:"brutal_debug,omitempty"` } diff --git a/outbound/hysteria2.go b/outbound/hysteria2.go index 2998f948..f2ffe2fd 100644 --- a/outbound/hysteria2.go +++ b/outbound/hysteria2.go @@ -61,6 +61,8 @@ func NewHysteria2(ctx context.Context, router adapter.Router, logger log.Context client, err := hysteria2.NewClient(hysteria2.ClientOptions{ Context: ctx, Dialer: outboundDialer, + Logger: logger, + BrutalDebug: options.BrutalDebug, ServerAddress: options.ServerOptions.Build(), SendBPS: uint64(options.UpMbps * hysteria.MbpsToBps), ReceiveBPS: uint64(options.DownMbps * hysteria.MbpsToBps),