Skip to content

Commit

Permalink
Update VShareLink Utils
Browse files Browse the repository at this point in the history
  • Loading branch information
chsbuffer committed Feb 20, 2021
1 parent ac0800e commit 17f88ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Netch/Servers/V2ray/V2rayUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static IEnumerable<Server> ParseVUri(string text)
break;
case "ws":
server.Path = Uri.UnescapeDataString(parameter.Get("path") ?? "/");
server.Host = parameter.Get("host") ?? "";
server.Host = Uri.UnescapeDataString(parameter.Get("host") ?? "");
break;
case "h2":
server.Path = Uri.UnescapeDataString(parameter.Get("path") ?? "/");
Expand Down Expand Up @@ -83,6 +83,7 @@ public static IEnumerable<Server> ParseVUri(string text)

public static string GetVShareLink(Server s, string scheme = "vmess")
{
// https://github.com/XTLS/Xray-core/issues/91
var server = (VMess.VMess) s;
var parameter = new Dictionary<string, string>();
// protocol-specific fields
Expand All @@ -107,7 +108,7 @@ public static string GetVShareLink(Server s, string scheme = "vmess")
case "ws":
parameter.Add("path", Uri.EscapeDataString(server.Path.IsNullOrWhiteSpace() ? "/" : server.Path));
if (!server.Host.IsNullOrWhiteSpace())
parameter.Add("host", server.Host);
parameter.Add("host", Uri.EscapeDataString(server.Host));

break;
case "h2":
Expand Down

0 comments on commit 17f88ab

Please sign in to comment.