我在创建HTTP连接时遇到以下异常。
<item name="android:homeAsUpIndicator">@drawable/back</item>
以下是我的代理配置。
2017-08-07 17:07:43,219 ERROR au.com.scraper.sites.ScraperSite - Exception in parsing Categories: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 403 Forbidden" at line number 153
java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 403 Forbidden"
at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:2085)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:183)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:563)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:540)
at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:227)
at org.jsoup.helper.HttpConnection.get(HttpConnection.java:216)
at org.jsoup.Jsoup.parse(Jsoup.java:183)
at au.com.scraper.sites.ScraperSite.getCategories(ScraperSite.java:127)
at au.com.scraper.sites.AScraperSites.execute(AScraperSites.java:74)
at au.com.scraper.Scraper.main(Scraper.java:88)
以下是我的Proxy Authenticator类。
Authenticator.setDefault(new ProxyAuthenticator("user_name", "password"));
System.setProperty("https.proxyHost", server);
System.setProperty("https.proxyPort", port);
System.setProperty("http.proxyHost", server);
System.setProperty("http.proxyPort", port);
任何人都能说明为什么会出现这个问题吗?
答案 0 :(得分:-1)
您的代理服务器可能正在阻止该网址,当该地址是本地地址而您的代理服务器将阻止该地址时,我们可能会遇到此问题。