Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c565ede

Browse files
committed
Fix HTTPcontroller address setting issue
Fix Privoxycontroller socks5 server address issue and local http proxy address issue Fix forms tabindex
1 parent c2c1606 commit c565ede

File tree

6 files changed

+64
-56
lines changed

6 files changed

+64
-56
lines changed

Netch/Controllers/HTTPController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public bool Start(Objects.Server server, Objects.Mode mode)
4242
using (var registry = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true))
4343
{
4444
registry.SetValue("ProxyEnable", 1);
45-
registry.SetValue("ProxyServer", $"{Global.Settings.LocalAddress}:{Global.Settings.HTTPLocalPort}");
45+
registry.SetValue("ProxyServer", $"127.0.0.1:{Global.Settings.HTTPLocalPort}");
4646

4747
Win32Native.InternetSetOption(IntPtr.Zero, 39, IntPtr.Zero, 0);
4848
Win32Native.InternetSetOption(IntPtr.Zero, 37, IntPtr.Zero, 0);

Netch/Controllers/PrivoxyController.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,15 @@ public bool Start(Objects.Server server, Objects.Mode mode)
3636
return false;
3737
}
3838

39-
File.WriteAllText("data\\privoxy.conf", File.ReadAllText("bin\\default.conf").Replace("_BIND_PORT_", Global.Settings.HTTPLocalPort.ToString()).Replace("_DEST_PORT_", Global.Settings.Socks5LocalPort.ToString()));
39+
if (server.Type != "Socks5")
40+
{
41+
File.WriteAllText("data\\privoxy.conf", File.ReadAllText("bin\\default.conf").Replace("_BIND_PORT_", Global.Settings.HTTPLocalPort.ToString()).Replace("_DEST_PORT_", Global.Settings.Socks5LocalPort.ToString()).Replace("0.0.0.0", Global.Settings.LocalAddress));
42+
}
43+
else
44+
{
45+
File.WriteAllText("data\\privoxy.conf", File.ReadAllText("bin\\default.conf").Replace("_BIND_PORT_", Global.Settings.HTTPLocalPort.ToString()).Replace("_DEST_PORT_", server.Port.ToString()).Replace("0.0.0.0", Global.Settings.LocalAddress));
46+
}
47+
4048

4149
Instance = new Process()
4250
{

Netch/Forms/Server/Shadowsocks.Designer.cs

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Netch/Forms/Server/ShadowsocksR.Designer.cs

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Netch/Forms/Server/Socks5.Designer.cs

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)