Exemple #1
0
        public string GetShareLink(Server s)
        {
            if (Global.Settings.V2RayConfig.V2rayNShareLink)
            {
                var server = (VMess)s;

                var vmessJson = JsonSerializer.Serialize(new V2rayNSharing
                {
                    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.TLSSecureType
                },
                                                         new JsonSerializerOptions
                {
                    Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping
                });

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

            return(V2rayUtils.GetVShareLink(s));
        }
Exemple #2
0
 public string GetShareLink(Server s)
 {
     return(V2rayUtils.GetVShareLink(s, "vless"));
 }