mirror of
https://github.com/2dust/v2rayN.git
synced 2025-04-20 06:02:23 +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()
|
private static async Task InitText()
|
||||||
{
|
{
|
||||||
var path = Path.Combine(_configPath, "pac.txt");
|
var path = Path.Combine(_configPath, "pac.txt");
|
||||||
if (!File.Exists(path))
|
if (File.Exists(path))
|
||||||
{
|
{
|
||||||
|
File.Delete(path);
|
||||||
|
}
|
||||||
var pac = EmbedUtils.GetEmbedText(Global.PacFileName);
|
var pac = EmbedUtils.GetEmbedText(Global.PacFileName);
|
||||||
await File.AppendAllTextAsync(path, pac);
|
await File.AppendAllTextAsync(path, pac);
|
||||||
}
|
|
||||||
|
|
||||||
var pacText =
|
var pacText =
|
||||||
(await File.ReadAllTextAsync(path)).Replace("__PROXY__", $"PROXY 127.0.0.1:{_httpPort};DIRECT;");
|
(await File.ReadAllTextAsync(path)).Replace("__PROXY__", $"PROXY 127.0.0.1:{_httpPort};DIRECT;");
|
||||||
|
|
Loading…
Reference in a new issue