mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 04:30:08 +00:00
support hysteria for sing, remove hy core
This commit is contained in:
@@ -226,6 +226,15 @@ func getInboundOptions(tag string, info *panel.NodeInfo, c *conf.Options) (optio
|
||||
in.TrojanOptions.FallbackForALPN = fallbackForALPN
|
||||
}
|
||||
}
|
||||
case "hysteria":
|
||||
in.Type = "hysteria"
|
||||
in.HysteriaOptions = option.HysteriaInboundOptions{
|
||||
ListenOptions: listen,
|
||||
UpMbps: info.UpMbps,
|
||||
DownMbps: info.DownMbps,
|
||||
Obfs: info.HyObfs,
|
||||
TLS: &tls,
|
||||
}
|
||||
}
|
||||
return in, nil
|
||||
}
|
||||
|
||||
@@ -265,5 +265,7 @@ func (b *Box) Protocols() []string {
|
||||
return []string{
|
||||
"v2ray",
|
||||
"shadowsocks",
|
||||
"trojan",
|
||||
"hysteria",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +59,15 @@ func (b *Box) AddUsers(p *core.AddUsersParams) (added int, err error) {
|
||||
}
|
||||
}
|
||||
err = b.inbounds[p.Tag].(*inbound.Trojan).AddUsers(us)
|
||||
case "hysteria":
|
||||
us := make([]option.HysteriaUser, len(p.UserInfo))
|
||||
for i := range p.UserInfo {
|
||||
us[i] = option.HysteriaUser{
|
||||
Name: p.UserInfo[i].Uuid,
|
||||
AuthString: p.UserInfo[i].Uuid,
|
||||
}
|
||||
}
|
||||
err = b.inbounds[p.Tag].(*inbound.Hysteria).AddUsers(us)
|
||||
}
|
||||
if err != nil {
|
||||
return 0, err
|
||||
@@ -91,6 +100,10 @@ func (b *Box) DelUsers(users []panel.UserInfo, tag string) error {
|
||||
del = i.(*inbound.VMess)
|
||||
case "shadowsocks":
|
||||
del = i.(*inbound.ShadowsocksMulti)
|
||||
case "trojan":
|
||||
del = i.(*inbound.Trojan)
|
||||
case "hysteria":
|
||||
del = i.(*inbound.Hysteria)
|
||||
}
|
||||
} else {
|
||||
return errors.New("the inbound not found")
|
||||
|
||||
Reference in New Issue
Block a user