Skip to content

Commit

Permalink
修正singbox内核hy2用户列表问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wyx2685 committed Feb 21, 2024
1 parent 55b20f5 commit 96b457d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions core/sing/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,22 @@ func (b *Sing) AddUsers(p *core.AddUsersParams) (added int, err error) {
us := make([]option.HysteriaUser, len(p.Users))
for i := range p.Users {
us[i] = option.HysteriaUser{
Name: string(p.Users[i].Id),
Name: p.Users[i].Uuid,
AuthString: p.Users[i].Uuid,
}
}
err = b.inbounds[p.Tag].(*inbound.Hysteria).AddUsers(us)
case "hysteria2":
us := make([]option.Hysteria2User, len(p.Users))
id := make([]int, len(p.Users))
for i := range p.Users {
us[i] = option.Hysteria2User{
Name: string(p.Users[i].Id),
Name: p.Users[i].Uuid,
Password: p.Users[i].Uuid,
}
id[i] = p.Users[i].Id
}
err = b.inbounds[p.Tag].(*inbound.Hysteria2).AddUsers(us)
err = b.inbounds[p.Tag].(*inbound.Hysteria2).AddUsers(us, id)
}
if err != nil {
return 0, err
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,4 @@ require (
)

//github.com/apernet/hysteria/core v1.3.5-0.20240201034858-bb99579bb92c => /root/hysteria/core
replace github.com/sagernet/sing-box v1.9.0 => github.com/wyx2685/sing-box_mod v0.0.3
replace github.com/sagernet/sing-box v1.9.0 => github.com/wyx2685/sing-box_mod v0.0.4
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -800,8 +800,8 @@ github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1Y
github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
github.com/vultr/govultr/v2 v2.17.2 h1:gej/rwr91Puc/tgh+j33p/BLR16UrIPnSr+AIwYWZQs=
github.com/vultr/govultr/v2 v2.17.2/go.mod h1:ZFOKGWmgjytfyjeyAdhQlSWwTjh2ig+X49cAp50dzXI=
github.com/wyx2685/sing-box_mod v0.0.3 h1:UYLZZzoAzdai+ehsc2kSQJq9p9WQ5wVaZWuZtPddLOQ=
github.com/wyx2685/sing-box_mod v0.0.3/go.mod h1:Q5C14BKQoRzkJ+JPGuMdffHZEoOrlU1zsiBkTtfPoA0=
github.com/wyx2685/sing-box_mod v0.0.4 h1:fEZnkrtUwqJS/6M3drSdv9RXyRvhnuD2UV6rK5U6rLA=
github.com/wyx2685/sing-box_mod v0.0.4/go.mod h1:Q5C14BKQoRzkJ+JPGuMdffHZEoOrlU1zsiBkTtfPoA0=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
Expand Down

0 comments on commit 96b457d

Please sign in to comment.