Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / JScript / May 2006

Tip: Looking for answers? Try searching our database.

Help needed.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Wayne Gore - 23 May 2006 12:52 GMT
Hi

I'm trying to configure our computers proxy settings using "automatic
configuration script" meaning a .pac file.

The .pac file is actually a jscript file.
I only know VBScript and feel rather lost with JScript to be honest and I
was therefor wondering if anyone can help me with this file.

I found an example file of this .pac file and the way it is built up is that
each site has its "IF" statement including the subnet, exceptions and proxy
address.

The thing is that we have a lot of sites and a lot of exceptions.
However, the exceptions are the same for all sites. This means that a lot of
the code is simply repeated again and again.

I'm looking for a way to alter the script so that it would be possible to
call a function from each "IF" statement which gets the "default proxy
exections" so that the code is not repeated.

Any suggestions out there?

Below is the code from the example file.

Thanks
Wayne Gore

========================

function FindProxyForURL(url, host)
{
// variable strings to return
var proxy_yes = "PROXY 192.168.1.1:8080";
var proxy_no = "DIRECT";
if (shExpMatch(url, "http://www.mycompanywebsite.com*")) { return proxy_no; }
if (shExpMatch(url, "http://www.myotherwebsite.com*")) { return proxy_no; }
if (shExpMatch(url, "http://www.my3rdlocalsite.com*")) { return proxy_no; }
// Proxy anything else
return proxy_yes;
}
asdf - 27 May 2006 08:20 GMT
the extension should not matter.

the host will read e.g. text and interpret.

-------------------------

stick with what you get feedback from peers.

> Hi
>
[quoted text clipped - 37 lines]
> return proxy_yes;
> }

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.