绕过DNS查找并将URL提交给代理 [英] Bypass DNS lookup and submit URL to proxy

查看:175
本文介绍了绕过DNS查找并将URL提交给代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有使用Apache HttpComponents发出Web请求的Java应用程序. 我已使用JVM属性将应用程序配置为使用代理服务器

I have Java application that uses Apache HttpComponents to make web request. I have configured the application to use Proxy Servers using the JVM Property

java -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3132

当前,我的Java应用程序客户端在进行DNS查找时会失败. 我希望代理服务器执行DNS解析,就像Web浏览器在自动代理服务器配置模式(使用.pac文件)中所做的一样.

Currently my java application client makes DNS lookup in which it will fail. I want the Proxy to do the DNS resolution just like how web browsers do in automatic Proxy configuration mode (with .pac files).

推荐答案

尝试在此处查找: http://hc .apache.org/httpcomponents-client-ga/httpclient/examples/org/apache/http/examples/client/ClientExecuteProxy.java

似乎您需要使用setProxy()而不是全局属性来指定代理.

It seems as though you need to specify a proxy using setProxy() and not global properties.

这篇关于绕过DNS查找并将URL提交给代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆