+ Post New Thread
Results 1 to 10 of 10
How do you do....it? Thread, Pac File Issues in Technical; Hi All I am having some issues with internal IP Address in my Pac File. In the pac file the ...
  1. #1

    Join Date
    Jul 2009
    Location
    Wolverhampton
    Posts
    116
    Thank Post
    6
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Pac File Issues

    Hi All

    I am having some issues with internal IP Address in my Pac File.

    In the pac file the main address's work fine, 10.#.#.#, getting to printers in a web browser is not a problem.

    But our VOIP has its own 192.168.0.# range, but this is not working. We have added two different coding in the file and neither work. I just get a search in Google

    1st

    dnsDomainIs(host, "192.168.0.*") ||

    2nd

    url.substring(0,10)=="http://192.168.0.*" ||

    The 10 range works with the code below

    url.substring(0,10)=="http://10." | |

    Any thoughts please?

    the url.substring code was supplied by BGFL. The dnsDomainIs was in the original file we used. Just not get the 192 addresses to work

    Thanks

    Phil

  2. #2
    OllieC's Avatar
    Join Date
    Jun 2009
    Location
    Derby/Birmingham
    Posts
    187
    Thank Post
    17
    Thanked 16 Times in 10 Posts
    Rep Power
    13
    I've had a quick scour round the forums...
    Some useful looking posts....
    proxy .pac file
    .pac file problem

    I'm sure someone else will know exactly what to do but I guess there's something for you to play around with there. :P

  3. #3

    Join Date
    Jul 2009
    Location
    Wolverhampton
    Posts
    116
    Thank Post
    6
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    should you not be revising?

  4. #4
    OllieC's Avatar
    Join Date
    Jun 2009
    Location
    Derby/Birmingham
    Posts
    187
    Thank Post
    17
    Thanked 16 Times in 10 Posts
    Rep Power
    13
    I'm allowed to take a few mins to browse the internet. ;P

  5. #5


    tom_newton's Avatar
    Join Date
    Sep 2006
    Location
    Leeds
    Posts
    4,485
    Thank Post
    867
    Thanked 854 Times in 675 Posts
    Rep Power
    197
    url.substring(0,10)=="http://192.168.0.*" will never match - as the second string is longer than 10 characters. Needs to be 0,17.

    Should probably be using "isinnet" tho...

  6. #6

    Join Date
    Jul 2009
    Location
    Wolverhampton
    Posts
    116
    Thank Post
    6
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    whats isinnet??

  7. #7

    Join Date
    Jul 2009
    Location
    Wolverhampton
    Posts
    116
    Thank Post
    6
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    this is the file we was sent

    //start
    function FindProxyForURL(url, host)
    {
    if (isPlainHostName(host) ||
    dnsDomainIs(host, "*.arthurterry.bham.sch.uk") ||
    dnsDomainIs(host, ".bgfl.org") ||
    dnsDomainIs(host, ".bgfl.eu") ||
    dnsDomainIs(host, "myvle.org") ||
    dnsDomainIs(host, "*misportal.net") ||
    dnsDomainIs(host, "ats-ls01*") ||
    dnsDomainIs(host, "ats-isa01*") ||
    dnsDomainIs(host, "internet*") ||
    dnsDomainIs(host, "intranet*") ||
    dnsDomainIs(host, "192.168.0.*") ||
    url.substring(0,10)=="http://10." ||
    url.substring(0,18)=="http://192.168.0.*" ||
    url.substring(0,11)=="https://10." ||
    url.substring(0,9)=="ftp://10."
    )
    return "DIRECT"; //go direct
    else
    return "PROXY eduproxy.bgfl.org:80"
    }
    //end


    this is our original file which we used

    function FindProxyForURL(url, host) {
    if ( isInNet(host, "10.134.32.0", "255.255.240.0") ||
    dnsDomainIs(host,"https://webmail.arthurterry.bham.sch.uk") ||
    dnsDomainIs(host,"http://www.arthurterry.bham.sch.uk") ||
    dnsDomainIs(host,"ats-ls01.local.arthurterry.bham.sch.uk") ||
    dnsDomainIs(host,"ats-ls01") ||
    dnsDomainIs(host,"ats-isa01") ||
    dnsDomainIs(host,"arthurterry.misportal.net") ||
    dnsDomainIs(host,"intranet.local.arthurterry.bham. sch.uk") ||
    dnsDomainIs(host,"intranet") ||
    dnsDomainIs(host,"sharepoint.local.arthurterry.bha ms.sch.uk") ||
    dnsDomainIs(host,"sharepoint.arthurterry.bhams.sch .uk") ) {
    return "DIRECT";
    }
    else {
    return "PROXY eduproxy.bgfl.org:80";
    }
    }

    any advice?

  8. #8


    tom_newton's Avatar
    Join Date
    Sep 2006
    Location
    Leeds
    Posts
    4,485
    Thank Post
    867
    Thanked 854 Times in 675 Posts
    Rep Power
    197
    None of your "*" ones will work.
    Think carefully about what you are asking - substr takes a portion of the string - you are saying "are the first 18 characters of the URL equal to "http://192.168.0.*" - which they will never be, the * there is literal. Try "are the first 15 characters equal to "http://192.168." instead
    Code:
    url.substring(0,15)=="http://192.168."
    isInNet is the proper way to do it for IPs... you'll still need to "deal with" DNS names though - the browser doesn't resolve them - one of your examples takes a stab here:
    Code:
    isInNet(host, "10.134.32.0", "255.255.240.0")
    That's fairly specific
    Code:
    isInNet(host, "10.0.0.0", "255.0.0.0")
    would catch all 10. addresses

    and
    Code:
    isInNet(host, "192.168.0.0", "255.255.0.0")
    would catch all 192 addresses.
    Code:
    dnsDomainIs(host, "myvle.org") ||
    looks suspiciously like an example

    Code:
    dnsDomainIs(host, "*misportal.net") ||
    * won't work - replace it with a . to match all subdomains of misportal.net


    Code:
    dnsDomainIs(host, "ats-ls01*") ||
    dnsDomainIs(host, "ats-isa01*") ||
    dnsDomainIs(host, "internet*") ||
    dnsDomainIs(host, "intranet*") ||
    These are fixable - but I won't tell you how until you tell me why Its a really bad idea to put in prefixes - it could cause you all sorts of grief.

    If you can give a good list of what you need to go direct, and what needs to go proxy, we may be able to help draw up a less confused proxy.pac

  9. 3 Thanks to tom_newton:

    fil_b (23rd June 2010), OllieC (23rd June 2010), tommej (8th September 2010)

  10. #9

    Join Date
    Jul 2009
    Location
    Wolverhampton
    Posts
    116
    Thank Post
    6
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    hi tom

    Thats really useful information to help

    What do i need to add to allow 192 address as well as 10.134 address's

    Had a play to use 2 inisnet for 10.134 and 192, but it didnt work

    i guess it didnt work

    thanks

    Phil

  11. #10


    tom_newton's Avatar
    Join Date
    Sep 2006
    Location
    Leeds
    Posts
    4,485
    Thank Post
    867
    Thanked 854 Times in 675 Posts
    Rep Power
    197
    Bah. Had to make this "clever" didn't I

    This will go direct for:
    plain hosts (eg one word hosts like http://vle)
    10.xx.xx.xx IPs
    192.168.xx.xx IPs
    anything ending bgfl.eu or bgfl.org

    you can add new "endings" by adding another "push" line

    Not tested in the wild, just with google's pactester.

    Code:
    function FindProxyForURL(url, host)
    {
            if (isPlainHostName(host))
                    return "DIRECT";
            if (isInNet(host,"192.168.0.0","255.255.0.0"))
                    return "DIRECT";
            if (isInNet(host,"10.0.0.0","255.0.0.0"))
                    return "DIRECT";
            var endings = new Array();
            endings.push(".bgfl.org");
            endings.push(".bgfl.eu");
            var t;
            for (t in endings)
            {
                    if (host.match(endings[t] + "$"))
                            return "DIRECT";
            }
            return "PROXY eduproxy.bgfl.org:80";
    }

SHARE:
+ Post New Thread

Similar Threads

  1. PAC File and IE8
    By mpepprell in forum Internet Related/Filtering/Firewall
    Replies: 0
    Last Post: 6th April 2010, 01:25 PM
  2. Proxy .pac file
    By FN-GM in forum Internet Related/Filtering/Firewall
    Replies: 4
    Last Post: 10th February 2010, 10:33 AM
  3. .pac file problem
    By mrbios in forum Scripts
    Replies: 3
    Last Post: 16th October 2009, 11:28 AM
  4. proxy .pac file
    By sted in forum Windows
    Replies: 12
    Last Post: 24th September 2009, 07:50 PM
  5. Creating a PAC file
    By u8dmtm in forum Coding
    Replies: 4
    Last Post: 2nd March 2006, 03:49 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •