vless: support fallback to a http server

This commit is contained in:
nadoo committed 2020-10-04 18:26:44 +08:00
1 parent 422869b37a
commit 829a0d7f80
6 files changed
+60 -47

No files matched your search

+10 -4
View File
@@ -24,10 +24,11 @@ const (
// VLess struct.
type VLess struct {
dialer proxy.Dialer
proxy proxy.Proxy
addr string
uuid [16]byte
dialer proxy.Dialer
proxy proxy.Proxy
addr string
uuid [16]byte
fallback string
}
func init() {
@@ -55,6 +56,11 @@ func NewVLess(s string, d proxy.Dialer, p proxy.Proxy) (*VLess, error) {
uuid: uuid,
}
v.fallback = "127.0.0.1:80"
if custom := u.Query().Get("fallback"); custom != "" {
v.fallback = custom
}
return v, nil
}