mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 19:56:51 +08:00
fix: ports of hysteria is optional
This commit is contained in:
parent
9c1bdc686c
commit
c1189015ad
|
@ -91,7 +91,7 @@ type HysteriaOption struct {
|
||||||
Name string `proxy:"name"`
|
Name string `proxy:"name"`
|
||||||
Server string `proxy:"server"`
|
Server string `proxy:"server"`
|
||||||
Port int `proxy:"port"`
|
Port int `proxy:"port"`
|
||||||
Ports string `proxy:"ports"`
|
Ports string `proxy:"ports,omitempty"`
|
||||||
Protocol string `proxy:"protocol,omitempty"`
|
Protocol string `proxy:"protocol,omitempty"`
|
||||||
ObfsProtocol string `proxy:"obfs-protocol,omitempty"` // compatible with Stash
|
ObfsProtocol string `proxy:"obfs-protocol,omitempty"` // compatible with Stash
|
||||||
Up string `proxy:"up"`
|
Up string `proxy:"up"`
|
||||||
|
@ -137,7 +137,7 @@ func NewHysteria(option HysteriaOption) (*Hysteria, error) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
var addr string
|
var addr string
|
||||||
if option.Ports == "" {
|
if len(option.Ports) == 0 {
|
||||||
addr = net.JoinHostPort(option.Server, strconv.Itoa(option.Port))
|
addr = net.JoinHostPort(option.Server, strconv.Itoa(option.Port))
|
||||||
} else {
|
} else {
|
||||||
addr = net.JoinHostPort(option.Server, option.Ports)
|
addr = net.JoinHostPort(option.Server, option.Ports)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user