mirojr Posted September 9, 2011 Posted September 9, 2011 Hello, I have a proxy.pac file that works great if it is residing locally on a machine, and the browser(IE9) has the setting "Use automatic configuration script" set to: file://c:/proxypac/proxy.pac But if I try to get it on my webserver, which is apache2, running squid, it doesnt work. I am not sure how to make it work, or where it resides. I tried the /var/www/ which is the root of my server. I am trying to get this up and running then i can use with ipads later. But first things first. Anyone any info that might help me please? Thanks
Steve21 Posted September 9, 2011 Posted September 9, 2011 Did you add the MIME filetype to display it properly, not just as a textfile? Steve
tom_newton Posted September 9, 2011 Posted September 9, 2011 Content-Type: application/x-ns-proxy-autoconfig is what it should return. On your apache server (presume it is linux), run: curl -I /proxy.pac to check the headers
Roberto Posted September 9, 2011 Posted September 9, 2011 Ok. It's a standard file that you're publishing on a webserver. You need to place it in a visible "website" so that you could browse to it with a web browser (in fact my next step is to browse to the URL you're publishing it under with your browser to see if you can 'see' the file). So, with that done, can you browse to the URL of the .pac file wit... oh wait repeating myself, sorry. Lastly and most importantly, as others have said, check the MIME file-type of the file is correct.
mirojr Posted September 9, 2011 Author Posted September 9, 2011 Thanks for the replies. I realised it was partially working after I posted. I also had conflicting information regarding mime type syntax, one mentioned application/x-javascript-config. Anyway mine looks like this: function FindProxyForURL(url, host) { if (shExpMatch(url, "http://intranet/")) { return "DIRECT"; } if (shExpMatch(url, "http://www.edugeek.net/")) { return "DIRECT"; } if (isInNet(myIpAddress(), "x.x.x.0", "255.255.255.0")) return "PROXY x.x.x.x:8080"; else return "DIRECT"; } I had another issue, but have been for my dinner since then and kinda lost track as I have many jobs to do. But I know one issue is I cannot get iPad to use this proxy address with the appended file name /proxy.pac THis being the real reason i am trying to use a proxy.pac ( i think i read somewhere that this was the answer to my ipad proxy woes) Thanks for help.
Roberto Posted September 9, 2011 Posted September 9, 2011 But I know one issue is I cannot get iPad to use this proxy address with the appended file name /proxy.pac THis being the real reason i am trying to use a proxy.pac ( i think i read somewhere that this was the answer to my ipad proxy woes) Thanks for help. Ah, you will have problems getting this to work reliably. Parts of Apple's iOS networking stack once you get beyond the basic tcp/ip stuff appear to have been written by a room full of drunken chimpanzees. Possibly wearing boxing gloves to type.
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