Skip to content

Commit

Permalink
读取ignore_client_bandwidth参数
Browse files Browse the repository at this point in the history
  • Loading branch information
wyx2685 committed Feb 15, 2025
1 parent 484faaf commit e502624
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
9 changes: 5 additions & 4 deletions api/panel/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion core/hy2/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 5 additions & 4 deletions core/sing/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down

6 comments on commit e502624

@nqzhang
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你好 我今天看到 发了最新版0.1.6
这个要在哪里设置啊 config.json 还是sing_origin.json里面
谢谢

@wyx2685
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v2board下发

@nqzhang
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

是这样么

@nqzhang
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image
我这样改了之后 看到服务端重启了 但是不确定这样的格式对不对

@wyx2685
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对的

@nqzhang
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的 谢谢

Please sign in to comment.