Support one-time authentication in ss urls for sharing

This commit implements the new ss protocol proposed here:
https://github.com/shadowsocks/shadowsocks-org/issues/16

Also removes a TODO in Server.cs. You are welcome.
This commit is contained in:
Mygod
2016-04-15 23:12:39 +08:00
parent 87aa9ebea0
commit 9c7b100f2b
2 changed files with 19 additions and 40 deletions
@@ -252,7 +252,9 @@ namespace Shadowsocks.Controller
public static string GetQRCode(Server server)
{
string parts = server.method + ":" + server.password + "@" + server.server + ":" + server.server_port;
string parts = server.method;
if (server.auth) parts += "-auth";
parts += ":" + server.password + "@" + server.server + ":" + server.server_port;
string base64 = Convert.ToBase64String(Encoding.UTF8.GetBytes(parts));
return "ss://" + base64;
}