Esempio n. 1
0
        List <Tuple <Model.Data.Vmess, string> > GenVmessTestData()
        {
            var data = new List <Tuple <Model.Data.Vmess, string> >();

            var vmessStandard = new Model.Data.Vmess
            {
                v    = "2",
                add  = "1.2.3.4",
                port = "1234",
                id   = "0",
                ps   = "standard",
            };

            var linkStandard = vmessStandard.ToVmessLink();

            var vmessNonStandard = new Model.Data.Vmess
            {
                v    = "2",
                add  = "1.2.3.4",
                port = "1234",
                id   = "0",
                ps   = "standard",
            };

            var linkNonStandard = vmessStandard.ToVmessLink().Replace(@"=", @"");

            data.Add(new Tuple <Model.Data.Vmess, string>(vmessStandard, linkStandard));
            data.Add(new Tuple <Model.Data.Vmess, string>(vmessNonStandard, linkNonStandard));
            return(data);
        }
Esempio n. 2
0
        private void btnOK_Click(object sender, System.EventArgs e)
        {
            // using vmess:// v1  do not need fix
            var vmess = new Model.Data.Vmess();

            vmess.add  = tboxHost.Text;
            vmess.port = tboxPort.Text;
            vmess.aid  = tboxAID.Text;
            vmess.id   = tboxUID.Text;
            vmess.ps   = tboxAlias.Text;

            if (rbtnWS.Checked)
            {
                vmess.net  = "ws";
                vmess.host = tboxWSPath.Text;
            }

            if (rbtnKCP.Checked)
            {
                vmess.net = "kcp";
                var index = Math.Max(0, cboxKCP.SelectedIndex);
                vmess.type = Model.Data.Table.kcpTypes[index];
            }

            if (rbtnTCP.Checked)
            {
                vmess.net = "tcp";
            }

            if (chkboxTLS.Checked)
            {
                vmess.tls = "tls";
            }

            slinkMgr.ImportLinkWithOutV2cfgLinks(vmess.ToVmessLink());
            this.Close();
        }