use local port in pac
This commit is contained in:
@@ -17,6 +17,7 @@ namespace Shadowsocks.Controller
|
||||
public static string PAC_FILE = "pac.txt";
|
||||
|
||||
FileSystemWatcher watcher;
|
||||
private Configuration _config;
|
||||
|
||||
public event EventHandler PACFileChanged;
|
||||
|
||||
@@ -25,6 +26,11 @@ namespace Shadowsocks.Controller
|
||||
this.WatchPacFile();
|
||||
}
|
||||
|
||||
public void UpdateConfiguration(Configuration config)
|
||||
{
|
||||
this._config = config;
|
||||
}
|
||||
|
||||
public bool Handle(byte[] firstPacket, int length, Socket socket)
|
||||
{
|
||||
try
|
||||
@@ -159,7 +165,7 @@ Connection: Close
|
||||
|
||||
private string GetPACAddress(byte[] requestBuf, int length, IPEndPoint localEndPoint)
|
||||
{
|
||||
return "PROXY " + localEndPoint.Address + ":8123;";
|
||||
return "PROXY " + localEndPoint.Address + ":" + this._config.localPort + ";";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,6 +196,7 @@ namespace Shadowsocks.Controller
|
||||
_pacServer = new PACServer();
|
||||
_pacServer.PACFileChanged += pacServer_PACFileChanged;
|
||||
}
|
||||
_pacServer.UpdateConfiguration(_config);
|
||||
if (gfwListUpdater == null)
|
||||
{
|
||||
gfwListUpdater = new GFWListUpdater();
|
||||
|
||||
Reference in New Issue
Block a user