From e502624fe4c3d13509ab18be5d7f9cd547dd94c4 Mon Sep 17 00:00:00 2001 From: wyx2685 Date: Sat, 15 Feb 2025 22:09:56 +0900 Subject: [PATCH] =?UTF-8?q?=E8=AF=BB=E5=8F=96ignore=5Fclient=5Fbandwidth?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/panel/node.go | 9 +++++---- core/hy2/config.go | 2 +- core/sing/node.go | 9 +++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/api/panel/node.go b/api/panel/node.go index 495f9d5..120d867 100644 --- a/api/panel/node.go +++ b/api/panel/node.go @@ -109,10 +109,11 @@ type HysteriaNode struct { type Hysteria2Node struct { CommonNode - UpMbps int `json:"up_mbps"` - DownMbps int `json:"down_mbps"` - ObfsType string `json:"obfs"` - ObfsPassword string `json:"obfs-password"` + Ignore_Client_Bandwidth bool `json:"ignore_client_bandwidth"` + UpMbps int `json:"up_mbps"` + DownMbps int `json:"down_mbps"` + ObfsType string `json:"obfs"` + ObfsPassword string `json:"obfs-password"` } type RawDNS struct { diff --git a/core/hy2/config.go b/core/hy2/config.go index 03a879b..d8aeaf2 100644 --- a/core/hy2/config.go +++ b/core/hy2/config.go @@ -382,7 +382,7 @@ func (n *Hysteria2node) getHyConfig(info *panel.NodeInfo, config *conf.Options, Conn: conn, Outbound: Outbound, BandwidthConfig: *n.getBandwidthConfig(info), - IgnoreClientBandwidth: c.IgnoreClientBandwidth, + IgnoreClientBandwidth: info.Hysteria2.Ignore_Client_Bandwidth, DisableUDP: c.DisableUDP, UDPIdleTimeout: c.UDPIdleTimeout, EventLogger: n.EventLogger, diff --git a/core/sing/node.go b/core/sing/node.go index b6ebde4..f75062e 100644 --- a/core/sing/node.go +++ b/core/sing/node.go @@ -369,10 +369,11 @@ func getInboundOptions(tag string, info *panel.NodeInfo, c *conf.Options) (optio } } in.Options = &option.Hysteria2InboundOptions{ - ListenOptions: listen, - UpMbps: info.Hysteria2.UpMbps, - DownMbps: info.Hysteria2.DownMbps, - Obfs: obfs, + ListenOptions: listen, + UpMbps: info.Hysteria2.UpMbps, + DownMbps: info.Hysteria2.DownMbps, + IgnoreClientBandwidth: info.Hysteria2.Ignore_Client_Bandwidth, + Obfs: obfs, InboundTLSOptionsContainer: option.InboundTLSOptionsContainer{ TLS: &tls, },