Jump to content

Recommended Posts

Posted

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?

Posted (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 by HarryMonkey
  • Thanks 1
Posted
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..
  • Thanks 1
Posted

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

  • Thanks 1
Posted
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.

Posted

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.

Posted

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.

Posted

Steve,

I installed it on my laptop ( currently using window 7) but it isn't working. When I try to open it, nothing happens.

Posted
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?

  • Thanks 1
Posted

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";

}

Posted
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.

  • Thanks 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...