mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
vless: support fallback to a http server
This commit is contained in:
1 parent
422869b37a
commit
829a0d7f80
6 files changed
+60
-47
No files matched your search
+10
-4
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user