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)); }
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); }
public bool Start(Server s, Mode mode) { File.WriteAllText("data\\last.json", V2rayConfigUtils.GenerateClientConfig(s, mode)); return(StartInstanceAuto("-config ..\\data\\last.json")); }