diff --git a/ray2sing/common.go b/ray2sing/common.go index 4f2aa7a..58340a5 100644 --- a/ray2sing/common.go +++ b/ray2sing/common.go @@ -97,20 +97,22 @@ func getFragmentOptions(decoded map[string]string) *option.TLSFragmentOptions { } func getMuxOptions(decoded map[string]string) *option.OutboundMultiplexOptions { mux := option.OutboundMultiplexOptions{} - mux.Protocol = decoded["mux"] + mux.Protocol = decoded["muxtype"] if mux.Protocol == "" { return nil } mux.Enabled = true - mux.MaxConnections = toInt(decoded["mux_max"]) - mux.MinStreams = toInt(decoded["mux_min"]) - mux.Padding = decoded["mux_pad"] == "true" + mux.MaxConnections = toInt(decoded["muxmaxc"]) + // mux.MinStreams = toInt(decoded["muxsmin"]) + mux.MaxStreams = toInt(decoded["muxsmax"]) + mux.MinStreams = toInt(decoded["mux"]) + mux.Padding = decoded["muxpad"] == "true" - if decoded["mux_up"] != "" && decoded["mux_down"] != "" { + if decoded["muxup"] != "" && decoded["muxdown"] != "" { mux.Brutal = &option.BrutalOptions{ Enabled: true, - UpMbps: toInt(decoded["mux_up"]), - DownMbps: toInt(decoded["mux_down"]), + UpMbps: toInt(decoded["muxup"]), + DownMbps: toInt(decoded["muxdown"]), } } return &mux @@ -122,10 +124,10 @@ func getTransportOptions(decoded map[string]string) (*option.V2RayTransportOptio net = decoded["type"] } if path == "" { - path = decoded["serviceName"] + path = decoded["servicename"] } // fmoption.Printf("\n\nheaderType:%s, net:%s, type:%s\n\n", decoded["headerType"], net, decoded["type"]) - if (decoded["type"] == "http" || decoded["headerType"] == "http") && net == "tcp" { + if (decoded["type"] == "http" || decoded["headertype"] == "http") && net == "tcp" { net = "http" } diff --git a/ray2sing/shadowsocks.go b/ray2sing/shadowsocks.go index 3601144..8f54e02 100644 --- a/ray2sing/shadowsocks.go +++ b/ray2sing/shadowsocks.go @@ -54,7 +54,7 @@ func ShadowsocksSingbox(shadowsocksUrl string) (*T.Outbound, error) { Method: defaultMethod, Password: u.Password, Plugin: decoded["plugin"], - PluginOptions: decoded["plugin_opts"], + PluginOptions: decoded["pluginopts"], }, } diff --git a/ray2sing/tuic.go b/ray2sing/tuic.go index 3d0a4c1..800bda6 100644 --- a/ray2sing/tuic.go +++ b/ray2sing/tuic.go @@ -32,8 +32,8 @@ func TuicSingbox(tuicUrl string) (*T.Outbound, error) { ServerOptions: u.GetServerOption(), UUID: u.Username, Password: u.Password, - CongestionControl: decoded["congestion_control"], - UDPRelayMode: decoded["udp_relay_mode"], + CongestionControl: decoded["congestioncontrol"], + UDPRelayMode: decoded["udprelaymode"], ZeroRTTHandshake: false, Heartbeat: T.Duration(10 * time.Second), OutboundTLSOptionsContainer: T.OutboundTLSOptionsContainer{ @@ -41,7 +41,7 @@ func TuicSingbox(tuicUrl string) (*T.Outbound, error) { Enabled: true, DisableSNI: decoded["sni"] == "", ServerName: decoded["sni"], - Insecure: decoded["allow_insecure"] == "1", + Insecure: decoded["allowinsecure"] == "1" || decoded["insecure"] == "1", ALPN: []string{"h3", "spdy/3.1"}, ECH: ECHOpts, }, diff --git a/ray2sing/url_schema.go b/ray2sing/url_schema.go index 1bea7c2..0221613 100644 --- a/ray2sing/url_schema.go +++ b/ray2sing/url_schema.go @@ -59,7 +59,7 @@ func ParseUrl(inputURL string, defaultPort uint16) (*UrlSchema, error) { } for key, values := range parsedURL.Query() { - data.Params[key] = strings.Join(values, ",") + data.Params[strings.ReplaceAll(strings.ToLower(key), "_", "")] = strings.Join(values, ",") } return data, nil diff --git a/ray2sing/vless.go b/ray2sing/vless.go index 52e77c5..e8517d6 100644 --- a/ray2sing/vless.go +++ b/ray2sing/vless.go @@ -27,7 +27,7 @@ func VlessSingbox(vlessURL string) (*T.Outbound, error) { } } - packetEncoding := decoded["packetEncoding"] + packetEncoding := decoded["packetencoding"] // if packetEncoding==""{ // packetEncoding="xudp" // } diff --git a/ray2sing/warp.go b/ray2sing/warp.go index cb8b699..7db5611 100644 --- a/ray2sing/warp.go +++ b/ray2sing/warp.go @@ -15,10 +15,12 @@ func WarpSingbox(url string) (*T.Outbound, error) { Tag: u.Name, CustomOptions: map[string]interface{}{ "warp": map[string]interface{}{ - "key": u.Username, - "host": u.Hostname, - "port": u.Port, - "fake_packets": u.Params["ifp"], + "key": u.Username, + "host": u.Hostname, + "port": u.Port, + "fake_packets": u.Params["ifp"], + "fake_packets_size": u.Params["ifps"], + "fake_packets_delay": u.Params["ifpd"], }, }, } diff --git a/ray2sing/wireguard.go b/ray2sing/wireguard.go index eed9d86..81aff61 100644 --- a/ray2sing/wireguard.go +++ b/ray2sing/wireguard.go @@ -20,27 +20,18 @@ func WiregaurdSingbox(url string) (*T.Outbound, error) { ServerOptions: u.GetServerOption(), PrivateKey: u.Params["pk"], - PeerPublicKey: u.Params["peer_pub"], + PeerPublicKey: u.Params["peerpub"], PreSharedKey: u.Params["psk"], FakePackets: u.Params["ifp"], }, } - if pk, ok := u.Params["private_key"]; ok { + if pk, ok := u.Params["privatekey"]; ok { out.WireGuardOptions.PrivateKey = pk } - if pk, ok := u.Params["privateKey"]; ok { - out.WireGuardOptions.PrivateKey = pk - } - if pub, ok := u.Params["peer_public_key"]; ok { - out.WireGuardOptions.PeerPublicKey = pub - } - if pub, ok := u.Params["peerPublicKey"]; ok { + if pub, ok := u.Params["peerpublickey"]; ok { out.WireGuardOptions.PeerPublicKey = pub } - if psk, ok := u.Params["pre_shared_key"]; ok { - out.WireGuardOptions.PreSharedKey = psk - } - if psk, ok := u.Params["presharedKey"]; ok { + if psk, ok := u.Params["presharedkey"]; ok { out.WireGuardOptions.PreSharedKey = psk } @@ -67,7 +58,7 @@ func WiregaurdSingbox(url string) (*T.Outbound, error) { out.WireGuardOptions.Reserved = append(out.WireGuardOptions.Reserved, uint8(num)) } } - if localAddressStr, ok := u.Params["local_address"]; ok { + if localAddressStr, ok := u.Params["localaddress"]; ok { localAddressParts := strings.Split(localAddressStr, ",") for _, part := range localAddressParts { prefix, err := netip.ParsePrefix(part)