mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-22 00:21:30 +00:00
Add brutal debug option for Hysteria2
This commit is contained in:
parent
31c294d998
commit
343e24969d
|
@ -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.
|
||||
|
|
|
@ -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 的调试信息日志记录。
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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 的调试信息日志记录。
|
||||
|
||||
### 拨号字段
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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"`
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue