コード例 #1
0
    public virtual async Task <Socks5Server> StartAsync(Server s)
    {
        await using (var fileStream = new FileStream(Constants.TempConfig, FileMode.Create, FileAccess.Write, FileShare.Read))
        {
            await JsonSerializer.SerializeAsync(fileStream, await V2rayConfigUtils.GenerateClientConfigAsync(s), Global.NewCustomJsonSerializerOptions());
        }

        await StartGuardAsync("-config ..\\data\\last.json");

        return(new Socks5Server(IPAddress.Loopback.ToString(), this.Socks5LocalPort(), s.Hostname));
    }
コード例 #2
0
        public bool Start(Server s, Mode mode)
        {
            var server = (Socks5)s;

            if (server.Auth() && !mode.SupportSocks5Auth)
            {
                File.WriteAllText("data\\last.json", V2rayConfigUtils.GenerateClientConfig(s, mode));
                if (StartInstanceAuto("-config ..\\data\\last.json"))
                {
                    return(true);
                }

                return(false);
            }

            return(true);
        }
コード例 #3
0
ファイル: VLESSController.cs プロジェクト: xxzbg/Netch
 public bool Start(Server s, Mode mode)
 {
     File.WriteAllText("data\\last.json", V2rayConfigUtils.GenerateClientConfig(s, mode));
     return(StartInstanceAuto("-config ..\\data\\last.json"));
 }