View Single Post
Old 12-16-2016, 03:44 AM   #11
waces
Member
waces began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Oct 2016
Device: kindle
Agree, but if it's just a proxy response time issue (which should occure when the client wait for the server defined in the PAC file to respond first and then move to Direct) it should work in the environment when the pac file response is prompt. But it's not the case. Just tested and even the server defined in the pac file available calibre cannot connect through it. And - as I checked the log file on the proxy server itself - unfortunately there was no request initiated by calibre (and alos checked the target hosts defined in the meta query available via the proxy, so there is no url blocking, and also no blocking on the standard http port required for query the meta data)

Yes, you're right but when the pac file reports back direct it means 2 thing. 1 the defined proxy server is not available and 2 the connection will goes through without defined proxy settings. But it doesn't mean there is no data flow in case of no-proxy situations. (If you want to deny all the traffic in case the user cannot access the proxy you need to remove the "direct" part from the pac file. In that case all the communication will be blocked if the proxy is unavailable. But it's a very rare situation.)

Quote:
Originally Posted by davidfor View Post
Which of course requires that the PAC file had been retrieved at some time. And that would mean I would need to configure calibre at work and start it there to retrieve the PAC file. An unusual situation, but it would catch someone following a set of instructions.

That doesn't agree with the more complicated samples I found. They all have conditional checks of the URL against a pattern with a return for that pattern. And not all included a non-proxied option for when it fell through. Plus, what you say sounds like the PAC file execution is checking the proxy availability, not returning the calculated proxy to the client to try.

One of the examples is http://findproxyforurl.com/example-pac-file/. In that example, it uses DIRECT for internal addresses and different proxies for all other sites. And the default when there is no earlier match is to use one of two proxy servers. To me that says that for everything except local and intranet addresses, the client uses a proxy. There is nothing in it that suggests a direct connection can be used for a general internet site. If this example is invalid, then based on the google search results, I would think that a lot of sites are using bad PAC files.

The example on the Wikipedia page ends with:

Code:
return "PROXY proxy.example.com:8080; DIRECT";
I can see that as "use proxy.example.com:8080 if it responds, otherwise go direct". But, I expected that as meaning the client is to do the test. But, what you say suggests that the actual result returned to the client is the proxy server if it is available, or "DIRECT" if it is not.



Yes, I know it is not new. And there has been plenty of time for it to be added to calibre. But, that's the point. Someone has to take the time to code it and add it. That means they are not doing something else. And as this is only the second mention of PAC files I can find in this forum, it isn't a highly desired feature. There are a lot of other things to do that people are asking for, so they will be done first.

But, I'm sure that if someone wants to code this, then Kovid will accept a patch.
waces is offline   Reply With Quote