FabIT Posted June 26, 2012 Posted June 26, 2012 I am trying to create a pac file for our proxy server at work. Employees have laptops and when they are at work. they use the proxy server settings. But they go home, they can't access Internet explore. I am trying to create a pac file that's going to let them use proxy server at work and then use automatic configuration script once they leave our subnet. Any one knows a good java script I can start with?
carvjo Posted June 26, 2012 Posted June 26, 2012 Hi FabIT - read this thread - there is a VBS that should do the job.. http://www.edugeek.net/forums/windows-7/96939-proxy-vs-home-use.html 1
HarryMonkey Posted June 26, 2012 Posted June 26, 2012 (edited) function FindProxyForURL(url, host) { if (isInNet(myIpAddress(), "192.168.1.0", "255.255.255.0")) return "PROXY 192.168.1.1:8080"; else return "DIRECT"; } Put this into your pac file. Just substitute the appropriate IP addresses for yours and the proxy Edited June 26, 2012 by HarryMonkey 1
FabIT Posted June 26, 2012 Author Posted June 26, 2012 Thanks carvjo, So with the VBS file, is there something that needs to be install on the laptop as well?
FabIT Posted June 26, 2012 Author Posted June 26, 2012 (edited) Carvjo, where do I place the VBS file? Edited June 26, 2012 by FabIT
carvjo Posted June 27, 2012 Posted June 27, 2012 I keep a copy of this file on staff laptops - and start it with a shortcut in the 'all programs - startup' location.. or you could just give a shortcut on the desktop and tell those with these problems to run this VBS when at home.. 1
jonatkinson Posted June 27, 2012 Posted June 27, 2012 We had a similar problem with users taking their laptops home and not being able to use it. I wrote a VB program that ran at logon, automatically set the proxy, but asked the user if they wanted to 'work from home' and disabled the proxy settings. It assumes your at school unless you tell it otherwise, so you don't have to do anything if your at school, only press the I'm at Home button if your not in school. Worked quite well, tested on Win7, but should work easy enough on other Win OS's too. Its currently configured for our proxy settings but can easily be modified for your own settings.. If you want a copy, let me know, ill dig it out 1
HarryMonkey Posted June 27, 2012 Posted June 27, 2012 Not quite sure why you would need a script if you're using a pac file. If you want somthing for users to run and select then proxy switcher from Onyxbox is the answer, free and just sits in the system tray, needs no configuration and works with XP, Vista and W7. http://www.onyxbox.co.uk/software/downloads/ps.htm 2
jonatkinson Posted June 27, 2012 Posted June 27, 2012 http://www.onyxbox.co.uk/software/downloads/ps.htm Wish i'd known about this last year! I wasted all of nearly a whole hour writing my own.. I could have had 3 brews in that time.
HarryMonkey Posted June 27, 2012 Posted June 27, 2012 Wish i'd known about this last year! I wasted all of nearly a whole hour writing my own.. I could have had 3 brews in that time. And at least half a pack of hobnobs.
FabIT Posted June 27, 2012 Author Posted June 27, 2012 Thanks Jonatkinson, Yes please, send me a copy and I will modify it to fit my settings at work. It will work very much. Another thing is that I have never used a VB file to do proxy settings, but I am familiar with pac file. So all the help to customize it will be appreciated.
FabIT Posted June 27, 2012 Author Posted June 27, 2012 Carvjo, I modified the VBscript U referred to me Proxy vs Home use. and I placed in the batch file. Still it didn't work. I tested it at work, but it didn't work. This is how I tested it === I unchecked the proxy server settings to see if I restart the internet explorer, that the check mark was going check marked itself.
FabIT Posted June 27, 2012 Author Posted June 27, 2012 Steve, I installed it on my laptop ( currently using window 7) but it isn't working. When I try to open it, nothing happens.
TheMan100 Posted June 27, 2012 Posted June 27, 2012 Steve, I installed it on my laptop ( currently using window 7) but it isn't working. When I try to open it, nothing happens. Perhaps you need to upgrade .NET Framework? 1
FabIT Posted June 28, 2012 Author Posted June 28, 2012 This is the pac file I have, but it isn't working. Anyone see an error? function FindProxyForURL(url, host) { // variable strings to return //var proxy_yes = "PROXY 156.127.55.122:8080"; var proxy_no = "DIRECT"; // Minneapolis if (isInNet(myIpAddress(), "156.126.221.0", "255.255.255.0")) return "PROXY 156.127.121.222:8080"; //Minneapolis2 if (isInNet(myIpAddress(), "156.xxx.xx.x", "255.255.254.0")) return "PROXY 156.127.xx.xxx:xxx"; else return "DIRECT"; }
jonatkinson Posted July 2, 2012 Posted July 2, 2012 Thanks Jonatkinson, Yes please, send me a copy and I will modify it to fit my settings at work. It will work very much. Another thing is that I have never used a VB file to do proxy settings, but I am familiar with pac file. So all the help to customize it will be appreciated. Sorry for the delay in replying, been away since Wednesday aft. I have uploaded a modified version of my software.. This will enable the proxy settings automatically when opened (whatever is currently set in IE) If you hit the Disable proxy button, it turns them off. If you do nothing it will automatically close after a few seconds. GET IT HERE Any trouble, queries let me know. Jon p.s. Apologies for the gratuitous advertising, but i'm going self employed next month and need as much publicity as possible. 1
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