2012年5月2日星期三

HttpClient: Detect Proxy Settings or Configuration Script from HttpClient (I/O and Streams forum at JavaRanch)

HttpClient: Detect Proxy Settings or Configuration Script from HttpClient (I/O and Streams forum at JavaRanch)

PAC is used by user agents to automatically select the right proxy based on the return values given by the javascript function.

In your case, the HttpClient won't be knowing how to interpret it I guess. You have to write the logic necessary to interpret the response and then connect using the right proxy.

But you state that even though you are hard coding the right proxy within your program, the connection is being refused. So check the parameters you are passing.

Are your proxy credentials correct, if any? Whats the HTTP status code you are getting?

Here are a few programs that work with PAC files. You can use them for testing your problem or analyze the code.

http://code.google.com/p/pacparser/
http://code.google.com/p/pactester/

没有评论:

发表评论