Switch to full style
Use this forum to post questions relating to WinGate, feature requests, technical or configuration problems
Post a reply

Changing WWW Proxy Connection settings automatically?

Jul 26 08 4:35 pm

Hi there,

I use WinGate to provide a WWW proxy for some applications I run on my laptop that can't use a SOCKS proxy by default. For this, I have WinGate listening on 127.0.0.1:8080 and the WWW Proxy Server>Properties>Connection is set to my SOCKS proxy.

However, when I'm working at home, the SOCKS proxy server is not accessible and so the applications using WinGate fail until I change the settings manually. And then again when I get back to the office.. as you can guess, this gets pretty tiring after some time.

My laptop currently has an application that changes browser proxy settings automatically when i change networks and can also run other programs (like bat files etc) on detecting a new network.

Hence, I was wondering if there is a way to change the WWW Proxy Server>Properties>Connection setting automatically through some command line setting?

Re: Changing WWW Proxy Connection settings automatically?

Jul 27 08 11:49 pm

Hi,

This could possibly be done by exporting the two settings from the registry and saving just the branch relating to the service you want to modify.

This would leave you with two registry files which you can import without input using regedit.

It would look something like this with two files, one called port80.reg and the other port8080.reg [examples]:

-------------------------------------------
@echo off
net stop wingateengine
regedit /s port80.reg
net start wingateengine
-------------------------------------------
@echo off
net stop wingateengine
regedit /s port8080.reg
net start wingateengine
-------------------------------------------

Each CMD file examples above will stop the Wingate Engine, import silently a registry file [in the same directory as the script] then start the Wingate Engine.

All precautions apply about editing the registry and importing files, if in doubt ... get someone to configure it for you.

Re: Changing WWW Proxy Connection settings automatically?

Jul 28 08 4:12 pm

I had wondered whether a registry import would work, but hadn't thought about the background service needing to be restarted.

A little bit of monitoring the registry branch for the WWW Service helped me figure out what was changing so I exported the branch after each change and then created a .bat file. After that the setting change worked perfectly.

Thanks a lot for the help!
Post a reply