wss: added a new scheme wss for convenience

This commit is contained in:
nadoo committed 2021-07-09 19:17:16 +08:00
1 parent a62674838e
commit 15f9e74e39
11 files changed
+166 -75

No files matched your search

+1 -5
View File
@@ -55,7 +55,7 @@ func NewTrojan(s string, d proxy.Dialer, p proxy.Proxy) (*Trojan, error) {
serverName: query.Get("serverName"),
certFile: query.Get("cert"),
keyFile: query.Get("key"),
// fallback: "127.0.0.1:80",
fallback: query.Get("fallback"),
}
if _, port, _ := net.SplitHostPort(t.addr); port == "" {
@@ -76,9 +76,5 @@ func NewTrojan(s string, d proxy.Dialer, p proxy.Proxy) (*Trojan, error) {
hash.Write([]byte(pass))
hex.Encode(t.pass[:], hash.Sum(nil))
if fb := u.Query().Get("fallback"); fb != "" {
t.fallback = fb
}
return t, nil
}