Pac file timeRange

Hi,
I would like to develop a pac file that would change proxy for a specified time range. Can anyone please help me.
here are an example of what I did:
function FindProxyForURL(url, host) {
if (timeRange(0, 7)) return "PROXY proxy1.com:3128";
if (timeRange(7, 12)) return "PROXY proxy2.com:3128";
if (timeRange(12, 0)) return "PROXY proxy3.com:3128";
Thank you!

Hi,
Regarding the issue here, please check if the below article could help here:
PAC file best practices
Please Note:
Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not
guarantee the accuracy of this information.
Have you tested the file already? Is there any error showed out?
function FindProxyForURL(url, host) {
if (timeRange(0, 7)) return "PROXY proxy1.com:3128";
if (timeRange(7, 12)) return "PROXY proxy2.com:3128";
if (timeRange(12, 0)) return "PROXY proxy3.com:3128";(I personally think here we could replace with “else
return “PROXY proxy3.com:3128” ”)
Best regards
Michael
If you have any feedback on our support, please click
here.
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

Similar Messages

  • Using a Pac File with the new Macbook Pros

    I have recently purchased a new Macbook pro and to access the internet at my college, I need to use a Pac File, and My class mate has the drop down option to select it due to their macbook pro is an older model and my new macbook doesn't, how do I get the "Using Pac File" option?
    Thanks people in advance for your help!

    OS X Lion is not being included as an install DVD with new Macs. (It does come pre-installed.) Apple is offering a $69 USB stick with Lion pre-installed for owners would like to own a solid state means of recovery. Lion is strictly internet based with its recovery features - in other words - Macs will need to be able to connect to the internet to restore a computer with HDD failure (or some other issue where you need to restore the system.)

  • Proxy.PAC file not working after upgrade to 10.9.2

    I have a local proxy.pac file and it was working happily before 10.9.2.
    It was loaded under "Network > Proxies > Automatic Proxy Configuration" and effective for all browsers (Chrome, Safari and Firefox).
    After upgrade to 10.9.2 seems like it's being totally ignored. I have a CNTLM proxy in my machine and can see the traffic coming in. Looking at logs, no traffic really comes in and all browsers try to access internet directly.
    If I set the proxy.pac directly in Firefox, it works but I want all my browsers and application. I want the same functionality as of 10.9.1 and before.

    I submitted a bug report to Apple. The problem is present since 10.9.2, now with 10.10 and iOS. I hope they will take this problem seriously.

  • Drop IE connection if PAC file not found

    When users are in the corporate network, their machines will grab the PAC file and use it.
    However, when they bring the machine back, since the machines are unable to grab the PAC file (without VPN), IE revert to direct connection, hence bypass PAC file settings and go to any sites they wanted.
    Is there a way to change the default settings of IE or the Windows to such that, if the PAC file is not present, no connect is allowed for IE.

    Hi Zacklu,
    As I know, when user leave the corporate network, it will be very hard to control the behavior of their actions, so I think it’s hard to achieve your goal.
    Could you please tell me why do you want to have this setting?
    Regards
    Yolanda
    TechNet Community Support

  • PAC file doesn't work in SAFARI 7.0.x

    Hi,
    To access the internet and emails at work I need to configure the proxy, which is done through pac file.
    I indicated the URL of the file to 'PREFERENCES' but it didn't work. As I am new to the Mac world, I searched at several places, but none of the tips solved my problem.
    I'm using Safari 7.0.x and Mavericks
    Can anyone help me?

    Probably the best bet is reading how those files are configured, and submit the settings through the System Preferences for Proxies
    http://en.wikipedia.org/wiki/Proxy_auto-config
    Textwrangler should be able to look at the file without modifying it and give you an idea of what commands need to be duplicated through the PRoxies settings in the System Preferences for Networking.

  • PAC file not working in IE 9

    I have the IE9 browser set to use the PAC file, but it does not send traffic to the WSA.  I have tried it locally from the C: drive and downloading it from the WSA PAC source.  Putting the link to the file opens it from either location.  It seems that it is not processing it.               
    Some document suggested to name it proxy.pac; this did not help.
    Here is the code to proxy when the WSA is available and go direct to the website when the WSA is not in the network the user is in (mobile users)
    function FindProxyForURL(url,host){
        return "PROXY 10.100.2.2:80;
        DIRECT;"

    I would highly recommend putting the WSA in the DNS resolution. Depending on what kind of authentication you are performing, you will need to resolve the hostname.
    Christian Rahl
    Customer Support Engineer
    Cisco Web Content Security Appliance
    Cisco Technical Assistance Center RTP

  • PAC file not working in IE10

    I recently upgraded to IE10 on my Windows 7 machine on our network, however IE seems to ignore the PAC file. It works on other machines which are running IE9, just not IE10.
    I also have a Windows 8 machine with IE10 and it doesn't seem to work either.

    This issue has started cropping up in my environment as well
    I have a pac file set on a webserver location (hosted in the cloud with no authentication for our source addresses). 
    I've checked the temporary internet files location and stuff is downloaded and saved there. What I see is the following 
    IE doesn't work, however the pac url is reachable. I run a wireshark and I see the pacfile retrieved and it passes the javascript to IE (the pac file is also downloaded). However IE never sends any requests to either of the 2 proxies, it just attempts direct
    connection.
    Further, for the rest, Chrome and any other app that uses IE settings for it's proxy info just continue to work no problems.
    Also with the exact same setup on IE9, no issues (whole company runs like this) if we were to upgrade the org to IE10, nobody would have internet anymore. Anybody found a fix?! 
    So far the warnings about this stuff I've found is 
    file based pac file support is deprecated -> host it on a web server - check. We do this, so this isn't it
    the temp file issue outlined above. I've checked temp file location, it's set, it's working and it's grabbing the pac file.
    so far as I can conclude at the moment is that IE10 has just stopped interpreting pac files. which is odd, because this has just started occuring in the last week with no environment changes. Something in a windows update?
    EDIT: while trying various options I found resetting the Internet explorer from advanced tab in internet options seemed to fix my issue. I'll leave the above here anyway as a 'working config'.

  • Lync 2013 client doesn't read proxy.pac file Lync exclusions

    Hi all,
    I have a very annoying issue where by the Lync 2013 client ignores the proxy.pac file exclusions set below:
    (host == "lync.test.domain") || (host == "lyncdiscoverinternal.test.domain") ||
    (host == "lyncwacdca.test.domain") ||
    (host == "lyncwacdcb.test.domain") ||
    (host == "lyncwebintdca.test.domain") ||
    (host == "lyncwebintdcb.test.domain")
    IE is set to use automatic configuration script of
    http://proxy.test.domain:8083/proxy.pac This file can be reached through and IE browser, downloaded and it's syntax read.
    If I set my proxy server and exclusions manually within IE9 then they are adhered to. That is Lync 2013 is able to read.
    My thinking: that some application may be iterferring with Lync 2013 getting to
    http://proxy.test.domain:8083/proxy.pac or reading in the exclusions set within the file.
    If I enter https://lync.test.domain into the browser URL search field I can see that it is being sent straight out to the proxy as opposed to bypassing it.
    Does anyone have an example of their proxy.pac exclusion set for Lync 2013 just in case my syntax is not looking the best.
    Cheers

    Update to this issue - solution was to move the proxy exclusions to the top of the proxy.pac
    Outcome resulted in Windows WinHTTP processing the the Lync proxy exclusions prior to the Lync.exe firing during logon. I don't believe you would see this in a typical infrastructure. Since initially looking into this issue I  have been
    able to show through packet traces, large periods of latency in delivery of desktop profile items due to backend profile storage issues.
    In eddition this moving the exclusions to the top of the pac file I made use of substrings. I don't believe the use of substrings is any better or worst, but just easier for others to understand what the exclusion allows specifically.
    Example of pac exclusion now:
    if (url.substring(0,39) == "http://lyncdiscoverinternal.testdomain.") { return "DIRECT"; } //matches 31 characters including last . or period
    I entered similar entries for all required exclusions. The result was Lync signing in within 6 seconds as opposed to the 40 second (through the user of legacy SRV records).

  • Java Verify and PAC Files

    We are have started using a PAC files to control how our Browsers connect to the Internet.
    What we have found out is Java won't use the PAC files when version Java version.
    Java installs just fine but fails on the "Verify Java Version".
    Here is the message you get: "We are unable to verify if Java is currently installed and enabled in your browser".
    If I un-check "Use automatic configuration script and check proxy server and point to the same web proxy IP used by the PAC file.  Java verifies.
    We found this issue when web applications started failing to open their java applets because it couldn't version the Java version.
    How do I get Java to use our PAC files?

    No. If you want to do that you should just use Access. mySQL files will not work without the mySQL server.

  • Performance degradation when using proxy.pac file with FF ESR 31

    With Bug 923458 many people complained about a performance issue compared to other browsers when a proxy.pac file is used.
    The issue initially reported with the bug was resolved for ESR25 according to the statistics, but the general performance issue remained.
    I had the same issue with ESR24 and ESR31.3 .
    I was testing with www.bild.de.
    It took about 40 seconds to load the content completely. Without the proxy.pac file it took about 10 seconds.
    I added a few alerts to the pac-File in order to get logs within the console for some analyses.
    I found the following:
    1. the pac.file is executed for every request, no matter if the host changed or not.
    With us the pac-File checks for IP-Adresses and host-names only.
    It is not necessary to execute the pac file for each and every request to the same remote host.
    So the question is, if we are able to disable this behaviour via about:config?
    2. the content referenced by www.bild.de seems to be loaded sequentially and with a delay
    The overall time consumed by the proxy.pac file executions was about 4 Seconds compared to the 40 seconds of overall load time.
    So I checked the delay between executions of the pac-file and found an overall delay of 40 seconds. I expect that the delay between the calls to the pac-file is caused by the retrieval of contents from the remote host.
    So why are the requests executed sequentially?
    Hint: Due to the times necessary for executing the pac-file and downloading the contents from the remote host, I would expect the logs generated by my alerts to be mixed (especially if myIpAddress took 1 Second). But the log is cleanly ordered by URL. (see attachment)

    Hi guigs2,
    thanks for your response. As we only use myIpAddress once within our pac-File and only rely on dnsDomainIs(), ==-Comparisons and shExpMatch() and the sum of all pac-Executions was about 4 seconds compared to 40 seconds overall load time, I do not think that dns resolving is our issue.
    I checked the seetings of the configuration you mentioned above. It is set to "false", so the client would try the resolve the dns names. Our admin told, that we do not use socks-Proxies, only http-Proxies.
    Regarding sequential load of the contents included on www.bild.de from other web sites, I attached a screenthot.
    Please note the red highlights. These show the start time in milliseconds of the pac-execution. I added this as a kind of id which represents a unique identifier together with the URL if the log items are mixed. But they are not, instead they are cleanly ordered by URL (for all 360 pac-file calls).
    Moreover in the picture you can see the delay between the end of the last pac-file execution and the next one (blue timestamp in millisonds compared to the red timestamp of the next row saying "entered proxy.pac"). The delay sum up exactly to the 40 seconds the FF took to load the page completely.
    Alone the fragment shown represents a delay of 630ms between the pac-file executions. If the contents would be loaded in parallel, there should be no such delay.

  • PAC file support for Proxy Servers

    When will AIR support PAC files for proxy servers?
    In our network, we can't point to a PAC file because the AIR app simply ignores it, and we experience comms issues because of it. The workaround is to configure the network settings to point directly at the proxy, bypassing the PAC file.
    This is a big problem as pointing directly at the proxy means a lot of manual configuration for each user that requires the use of the AIR app.
    Any clues or suggestions?

    Hi,
    Additional configurations (DHCP and DNS) are required when you use Automatically detect settings.
    For details, please refer to:
    Automatic Detection and Configuration of Browser Settings
    http://technet.microsoft.com/en-us/library/dd361887.aspx
    Hope this helps.
    Jeremy Wu
    TechNet Community Support

  • I want to install CCPL ,but it is not taking PAC file proxy.So please suggest an alternate way to set proxy for this exe file..

    I want to install CCPL ,but it is not taking PAC file proxy.So please suggest an alternate way to set proxy for this exe file..

    That file might have moved to a different location on the server. I think you'll need to check with RefWorks support or your local IT department on why the install page links do not work.

  • Issue with host resolution using a pac file on Internet Explorer 11

    Hi guys,
    I'm facing a weird issue on IE11 that is causing some complains from the end users. I've a pac file configured on IE11 and when I open the IE11 on the first time it takes around 45 seconds to load the webpage content. So I'm able to open a new tabs and type
    new addresses but the content is only loaded after 45 seconds.
    I was analysing the issue and I figured out that is related with a non-sense/stupid dns lookup when you have a pac file configured on IE11, using the rule isInNet(host, “pattern”, "mask").
    The first time you open IE11 the host is resolved as dummy, instead of the homepage or the web address typed, so you'll find a lot of queries by dummy, when it doesn't exist at all. If you have several dns servers configured and with a slow connection then
    you get around 45 seconds or more until you get the webpage content.
    This issue isn't appearing on IE8 or Google Chrome, so it should be some bug on IE11, I suppose.
    Please keep in mind that I've tested in using my corporate image and using a vanilla image (zero-customizations) and the behaviour/output was the same.
    Has someone faced the same issue already?
    Thanks in advance,
    Valter Anjos

    Hi Valter,
    I think this thread is specific to TechNet IE forum. So I am helping you to move this thread directly into that forum. Thank you for your understanding.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Stting auto pac file for all users

    What happened to all.js in Firefox 4.
    Need to be able to place a pac file into proxy settings for all users. Do not want to have to get the users to individually enter a pac file for their own profile.
    If this is no longer possible in version 4, I think Firefox is going to lose a lot of domain users

    js files in %PROGRAMFILES%\Mozilla Firefox\defaults\pref\ are read on startup (In reverse alphabetical order AFAIK). You can create a file here for your proxy settings. Works for me.
    cf : http://wpkg.org/Firefox#Setting_and_Locking_Preferences

  • Coverage Zones and PAC files

    Just wondering if anybody has used coverage zones and PAC files to do auth browser configuration.
    I'm looking at a global deployment of Content Engines (ACNS 5.1) and would like to set each CE up as a PAC server to respond to a request and direct the user to the nearest CE. So if I'm in Milan I use the Milan CE and when I go to London I use the London CE.
    I'm trying to get my head round this in the lab at present and want to get away with not using a Content Router only CE's. Can this be done?
    Any experience will be really helpful and I'll post any findings back to this thread.
    Thanks
    Mark

    Here is something that I found. ACNS 5.1 has the new auto proxy-config option which combines coverage zones with a proxy pac file. Essentially, you create a pac file that contains a special macro, and configure the CE (through the CDM GUI) to use that pac file in conjunction with the coverage zone information. Then, when the client requests that pac file from the CE, the CE replaces that macro in the pac file with one (or more) CE names based on the coverage zone that matches the requesting client's IP address. Link to the configuration.
    http://www.cisco.com/univercd/cc/td/doc/product/webscale/uce/acns51/deploy51/51router.htm#wp1039339

Maybe you are looking for

  • My iphone 5 is not listed in support page anymore

    I took my iphone 5 for sevice last suturday with a microphone issue.Since yesterday i could see it in my support page with other apple products.Today is not there! Any clue???

  • PDF conversion with PDF2ID; Hypertext not working when exported back to pdf.

    I have done a PDF conversion with PDF2ID, however Hypertext is not working when I exported it back to pdf. I am using the PDF2ID plug-in program to redo all the product booklets for our company as the hypertext did not work when downloaded to any sma

  • Embed Captivate v into MS PowerPoint 2003

    Is there a kind person out there who could send "simple step x step" instructions explaining how to embed a Captive v4 project into a MS Powerpoint 2003 slide ? Thanks in advance Noel

  • Download data from internet

    I need to retrive the data from instrument which is connect with my PC via the LAN cable. I have a new IP addreess for this device and i don't know how to retrive the data from this device.. i m first learner in labview.. can sombody help me?

  • 10.7.2 Better than Snow Leopard 10.6.8?

    Hi. I downgraded to Snow Leopard but if are you happy with 10.7.2 or should I stick with 10.6.8 Snow for now? Thank you. I'm on a late iMac 2009 i7. Thank you in advance. Gbu, Alvin