Add brutal debug option for Hysteria2

This commit is contained in:
世界 2023-10-21 12:00:00 +08:00
parent 31c294d998
commit 343e24969d
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
7 changed files with 40 additions and 16 deletions

View file

@ -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).
Enable debug information logging for Hysteria Brutal CC.

View file

@ -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)。
启用 Hysteria Brutal CC 的调试信息日志记录。

View file

@ -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.

View file

@ -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 的调试信息日志记录。
### 拨号字段

View file

@ -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,

View file

@ -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 {
@ -30,4 +31,5 @@ type Hysteria2OutboundOptions struct {
Password string `json:"password,omitempty"`
Network NetworkList `json:"network,omitempty"`
TLS *OutboundTLSOptions `json:"tls,omitempty"`
BrutalDebug bool `json:"brutal_debug,omitempty"`
}

View file

@ -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),