BrettF Posted March 2, 2007 Share Posted March 2, 2007 Hi. I'm very luck for my school to be able to provide us with laptops, and it is getting very annoying to be having to turn the proxy on and off every time i need to use the internet. How can i detect if i am connected to a network and then turn theh proxy on or off. Thanks Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
lod3n Posted March 2, 2007 Share Posted March 2, 2007 Use a Wpad.dat file. Create the following file, say C:\wpad.dat, with these contents (modify to match your network(s) and proxy(s)): function FindProxyForURL(url, host) { if (isInNet(myIpAddress(), "192.168.1.0", "255.255.255.0")) return "PROXY 192.168.1.1:8080"; if (isInNet(myIpAddress(), "10.0.0.0", "255.255.255.0")) return "PROXY 10.0.0.1:8080"; return "DIRECT"; } Then go into Internet Explorer or Firefox connection settings, and tell it to use the automatic configuration script "c:\wpad.dat" Bingo presto, it always picks the right thing depending on your current IP address. [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
lod3n Posted March 2, 2007 Share Posted March 2, 2007 Also, if your network admins at your school have set up their DHCP to provide an automatic configuration script (similar to what you see above) then all you'd have to do is check Automatically Detect Settings, and nothing else, ever. [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
BrettF Posted March 2, 2007 Author Share Posted March 2, 2007 Also, if your network admins at your school have set up their DHCP to provide an automatic configuration script (similar to what you see above) then all you'd have to do is check Automatically Detect Settings, and nothing else, ever.Thanks. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now