Beispiel #1
0
        public string GetShareLink(Server s)
        {
            var server = (ShadowsocksR)s;

            // https://github.com/shadowsocksr-backup/shadowsocks-rss/wiki/SSR-QRcode-scheme
            // ssr://base64(host:port:protocol:method:obfs:base64pass/?obfsparam=base64param&protoparam=base64param&remarks=base64remarks&group=base64group&udpport=0&uot=0)
            var paraStr =
                $"/?obfsparam={ShareLink.URLSafeBase64Encode(server.OBFSParam ?? "")}&protoparam={ShareLink.URLSafeBase64Encode(server.ProtocolParam ?? "")}&remarks={ShareLink.URLSafeBase64Encode(server.Remark)}";

            return("ssr://" +
                   ShareLink.URLSafeBase64Encode(
                       $"{server.Hostname}:{server.Port}:{server.Protocol}:{server.EncryptMethod}:{server.OBFS}:{ShareLink.URLSafeBase64Encode(server.Password)}{paraStr}"));
        }
Beispiel #2
0
        public string GetShareLink(Server s)
        {
            var server = (VMess)s;

            var vmessJson = JsonConvert.SerializeObject(new
            {
                v    = "2",
                ps   = server.Remark,
                add  = server.Hostname,
                port = server.Port,
                id   = server.UserID,
                aid  = server.AlterID,
                net  = server.TransferProtocol,
                type = server.FakeType,
                host = server.Host,
                path = server.Path,
                tls  = server.TLSSecure ? "tls" : ""
            });

            return("vmess://" + ShareLink.URLSafeBase64Encode(vmessJson));
        }