mirror of
https://github.com/2dust/v2rayN.git
synced 2025-04-19 21:52:25 +00:00
Make the pac.txt file be recreated at every startup
This commit is contained in:
parent
d0e2cc9442
commit
f10ce6588f
1 changed files with 4 additions and 3 deletions
|
@ -33,11 +33,12 @@ namespace ServiceLib.Handler
|
|||
private static async Task InitText()
|
||||
{
|
||||
var path = Path.Combine(_configPath, "pac.txt");
|
||||
if (!File.Exists(path))
|
||||
if (File.Exists(path))
|
||||
{
|
||||
File.Delete(path);
|
||||
}
|
||||
var pac = EmbedUtils.GetEmbedText(Global.PacFileName);
|
||||
await File.AppendAllTextAsync(path, pac);
|
||||
}
|
||||
|
||||
var pacText =
|
||||
(await File.ReadAllTextAsync(path)).Replace("__PROXY__", $"PROXY 127.0.0.1:{_httpPort};DIRECT;");
|
||||
|
|
Loading…
Reference in a new issue