Support one-time authentication in ss urls for sharing (#644)

This commit implements the new ss protocol proposed here: https://github.com/shadowsocks/shadowsocks-org/issues/16
This commit is contained in:
Mygod
2016-04-14 16:51:36 -07:00
committed by Max Lv
parent c8bb8fc929
commit e05abd7c24
2 changed files with 17 additions and 17 deletions
@@ -99,6 +99,6 @@ class Profile {
@DatabaseField
var userOrder: Long = _
override def toString = "ss://" + Base64.encodeToString("%s:%s@%s:%d".formatLocal(Locale.ENGLISH,
method, password, host, remotePort).getBytes, Base64.NO_PADDING | Base64.NO_WRAP)
override def toString = "ss://" + Base64.encodeToString("%s%s:%s@%s:%d".formatLocal(Locale.ENGLISH,
method, if (auth) "-auth" else "", password, host, remotePort).getBytes, Base64.NO_PADDING | Base64.NO_WRAP)
}