2dust 5 years ago
parent 37af5f372a
commit 4eb7f312b5

@ -62,7 +62,7 @@ namespace v2rayN.HttpProxyHandler
{
string address = ctx.Request.LocalEndPoint.Address.ToString();
string rstr = _responderMethod(address);
byte[] buf = Encoding.ASCII.GetBytes(rstr);
byte[] buf = Encoding.UTF8.GetBytes(rstr);
ctx.Response.StatusCode = 200;
ctx.Response.ContentType = "application/x-ns-proxy-autoconfig";
ctx.Response.ContentLength64 = buf.Length;

@ -75,7 +75,7 @@ namespace v2rayN.HttpProxyHandler
public static List<string> ParseResult(string response)
{
byte[] bytes = Convert.FromBase64String(response);
string content = Encoding.ASCII.GetString(bytes);
string content = Encoding.UTF8.GetString(bytes);
List<string> valid_lines = new List<string>();
using (var sr = new StringReader(content))
{

@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
using v2rayN.Mode;
using v2rayN.Properties;
@ -28,19 +26,22 @@ namespace v2rayN.HttpProxyHandler
public static void Init(Config config)
{
if (InitServer("*"))
{
pacPort = Global.pacPort;
}
else if (InitServer("127.0.0.1"))
{
var serverB = new HttpWebServerB(Global.pacPort, SendResponse);
pacPort = Global.pacPort;
}
else
{
Utils.SaveLog("Webserver init failed ");
pacPort = 0;
}
//if (InitServer("*"))
//{
// pacPort = Global.pacPort;
//}
//else if (InitServer("127.0.0.1"))
//{
// pacPort = Global.pacPort;
//}
//else
//{
// Utils.SaveLog("Webserver init failed ");
// pacPort = 0;
//}
}
private static bool InitServer(string address)

@ -182,6 +182,7 @@
<Compile Include="Handler\StatisticsHandler.cs" />
<Compile Include="Handler\V2rayUpdateHandle.cs" />
<Compile Include="HttpProxyHandler\HttpWebServer.cs" />
<Compile Include="HttpProxyHandler\HttpWebServerB.cs" />
<Compile Include="HttpProxyHandler\PACFileWatcherHandle.cs" />
<Compile Include="HttpProxyHandler\PrivoxyHandler.cs" />
<Compile Include="HttpProxyHandler\PACListHandle.cs" />

Loading…
Cancel
Save