|
|
@@ -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 + ";";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|