LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-19-2014, 08:20 PM   #1
ember1205
Member
 
Registered: Oct 2014
Posts: 176

Rep: Reputation: 16
proxy.pac / wpad.dat Not Working


Hi, all.

Newbie here on this particular forum, but not new to Linux or the programs that go with it. I also have a healthy tenure of experience with operating systems and networking in general. But, I'm completely stuck on this.

I have a linux machine running Apache2 and Squid. Both work just fine, and I can easily pass browsing traffic through Squid with an iptables redirect (transparent mode). This machine is also my internal DNS server for "home.local".

Squid:
Runs on port 3127 for transparent proxy
Runs on port 3128 for standard proxy

DNS:
Record for wpad points to web server

Apache:
proxy.pac and wpad.dat files present, virtual server has ServerAlias for wpad
Logs show whichever file is being downloaded (code 200)
MIMETYPES FILE HAS
application/x-ns-proxy-autoconfig pac
application/x-ns-proxy-autoconfig dat

DHCP:
option local-pac-server code 252 = text;
option local-pac-server "http://10.10.10.10:80/proxy.pac";

PROXY.PAC / WPAD.DAT
function FindProxyForURL(url, host) {
var proxy = "PROXY 10.10.10.10:3127; DIRECT";
var direct = "DIRECT";
return proxy;
}



I have also attempted to use port 3128 for the proxy in the files, but the results are the same.

If I configure the browser to use port 3128 directly, it works fine. I am not able to get the browser to recognize the proxy via Auto Discovery or an Autoconfiguration URL.

Where am I going wrong?
 
Old 10-23-2014, 02:44 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,104

Rep: Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638
Maybe get rid of the direct stuff and concentrate on out proxy working to start.

return "PROXY x.x.x.x:8080; PROXY y.y.y.y:8080;";


May consider :8080

I'd stick with either proxy.pac or wpdat but not both.
 
Old 10-23-2014, 05:08 PM   #3
ember1205
Member
 
Registered: Oct 2014
Posts: 176

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by jefro View Post
Maybe get rid of the direct stuff and concentrate on out proxy working to start.

return "PROXY x.x.x.x:8080; PROXY y.y.y.y:8080;";


May consider :8080

I'd stick with either proxy.pac or wpdat but not both.
Why?

DNS is used to discover and use WPAD, DHCP gives out PROXY.PAC.


I've had a basic file that returned only PROXY, and it doesn't work. It appears that the file is found and downloaded by the browser but not used.
 
Old 10-23-2014, 08:41 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,104

Rep: Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638
In linux I usually put in the proxy.pac file in browser network settings. Did you put it in or trying let it automatically install?

Linux has never fixed proxy.pac for global and never will. Trying to put it there will never work for most apps. It does seem to work for some browsers.

Right now you are just trying to get part of the deal to work correct? Then move on to full operation.

Can put proxy.pac file as a local file too if needed.


You've probably seen all this but here in case any extra.
http://wiki.gentoo.org/wiki/ProxyAutoConfig

Last edited by jefro; 10-23-2014 at 08:46 PM.
 
Old 10-23-2014, 08:45 PM   #5
ember1205
Member
 
Registered: Oct 2014
Posts: 176

Original Poster
Rep: Reputation: 16
Predominantly, I want WPAD to auto-configure Mac, android, and i-Devices. These devices all leave the house network and return later on. And, I don't want to be futzing with the settings every time I pass one through the front door.
 
Old 10-24-2014, 02:58 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,104

Rep: Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638
They should work as far as I've read.

Did you try any tests?
 
Old 10-24-2014, 03:01 PM   #7
ember1205
Member
 
Registered: Oct 2014
Posts: 176

Original Poster
Rep: Reputation: 16
I detailed what I had done and how I observed the files being acquired - what sort of tests are you referring to, though?

I did take a proxy.pac that was working in IE, turned off the use of that file and set it to auto-discover. The same file was delivered to the browser, but the browser did not use the proxy.

I'm REALLY stumped on this.
 
Old 10-24-2014, 09:33 PM   #8
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,104

Rep: Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638
OK, so a windows system is working correctly?
 
Old 10-24-2014, 09:42 PM   #9
ember1205
Member
 
Registered: Oct 2014
Posts: 176

Original Poster
Rep: Reputation: 16
Define correctly. What I ultimately want is to be able to use auto discovery.

Focus testing on my Apple devices.

Mac
Set the proxy to automatically discover as a system level setting. Firefox sends all traffic through the proxy, even when attempting to exclude Amazon.com. Safari sends nothing through the proxy. Set Firefox to auto discover (system not discovering) and nothing is routed to the proxy.

iPad
Set network to auto discover, Safari routes nothing to the proxy.

I've verified that the proxy.pac file is being downloaded.
 
Old 10-25-2014, 02:30 PM   #10
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,104

Rep: Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638
Can you just make the proxy.pac local and use wpdat to select it?
 
Old 10-25-2014, 04:09 PM   #11
ember1205
Member
 
Registered: Oct 2014
Posts: 176

Original Poster
Rep: Reputation: 16
Huh?
 
Old 10-25-2014, 08:11 PM   #12
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,104

Rep: Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638
Instead of using http some address for proxy.pac. Make it some local location. It should work. Example of windows might be (and I forget it now) something like c:\someplace\proxy.pac as I recall. That would be the location of your proxy file and what you'd point to in browser to test. Then if works try to get wpad file to assign.
 
Old 10-25-2014, 08:15 PM   #13
ember1205
Member
 
Registered: Oct 2014
Posts: 176

Original Poster
Rep: Reputation: 16
Oh..

If I load the file as a proxy.pac in Firefox, it doesn't work. The exact same file queried from Mac OSX as proxy.pac via DHCP/DNS will cause Firefox to function properly, but Safari will not. And it seems that it isn't just Safari on the Mac - the iPad doesn't work properly either even though the OS does pick up the file.

There's no rhyme or reason to this that I can find.
 
Old 10-27-2014, 03:13 PM   #14
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,104

Rep: Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638Reputation: 3638
I know nothing about apple stuff. Maybe someone else can offer solution.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Auto Proxy script (PAC) not working properly ganesh24pal@gmail.com Linux - Server 2 09-03-2014 08:42 AM
[SOLVED] proxy.pac or wpad.dat question. jefro Programming 5 03-16-2012 03:14 AM
Proxy.pac file is not working zyothi Linux - Networking 19 06-10-2010 04:32 PM
Yast S/W update and wpad.dat for proxy settings ithawtewrong SUSE / openSUSE 0 05-19-2008 04:52 PM
I want to use wget configured with a wpad.dat proxy... stardotstar Linux - Networking 2 04-22-2008 05:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration