fix: shadowsocket sharing link

This commit is contained in:
mzz2017 2023-04-10 00:23:34 +08:00
parent 6ff68e533e
commit 02423fabec

View File

@ -3,15 +3,15 @@ package v2ray
import ( import (
"encoding/base64" "encoding/base64"
"fmt" "fmt"
"github.com/daeuniverse/dae/common"
"github.com/daeuniverse/dae/component/outbound/dialer"
"github.com/daeuniverse/dae/component/outbound/transport/tls"
"github.com/daeuniverse/dae/component/outbound/transport/ws"
jsoniter "github.com/json-iterator/go" jsoniter "github.com/json-iterator/go"
"github.com/mzz2017/softwind/netproxy" "github.com/mzz2017/softwind/netproxy"
"github.com/mzz2017/softwind/protocol" "github.com/mzz2017/softwind/protocol"
"github.com/mzz2017/softwind/protocol/direct" "github.com/mzz2017/softwind/protocol/direct"
"github.com/mzz2017/softwind/transport/grpc" "github.com/mzz2017/softwind/transport/grpc"
"github.com/daeuniverse/dae/common"
"github.com/daeuniverse/dae/component/outbound/dialer"
"github.com/daeuniverse/dae/component/outbound/transport/tls"
"github.com/daeuniverse/dae/component/outbound/transport/ws"
"net" "net"
"net/url" "net/url"
"regexp" "regexp"
@ -248,16 +248,18 @@ func ParseVmessURL(vmess string, option *dialer.GlobalOption) (data *V2Ray, err
if aid == "" { if aid == "" {
aid = q.Get("aid") aid = q.Get("aid")
} }
sni := q.Get("peer")
info = V2Ray{ info = V2Ray{
ID: subMatch[1], ID: subMatch[1],
Add: subMatch[2], Add: subMatch[2],
Port: subMatch[3], Port: subMatch[3],
Ps: ps, Ps: ps,
Host: obfsParam, Host: jsoniter.Get([]byte(obfsParam), "host").ToString(),
Path: path, Path: path,
Net: obfs, Net: obfs,
Aid: aid, Aid: aid,
TLS: map[string]string{"1": "tls"}[q.Get("tls")], TLS: map[string]string{"1": "tls"}[q.Get("tls")],
SNI: sni,
AllowInsecure: false, AllowInsecure: false,
} }
if info.Net == "websocket" { if info.Net == "websocket" {