我得到Connection timed out: connect
。如何通過代理從HTTPS URL獲取數據?
我的代碼:
System.setProperty("http.proxyHost", "proxy.mycompany.com");
System.setProperty("http.proxyPort", "8080");
String url = URL_BASE + "&limit=5";
URL u = new URL(url);
BufferedReader in = new BufferedReader(
new InputStreamReader(
u.openStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
檢查您的代理服務器是否需要驗證,然後傳遞用戶名/密碼。 – sudmong 2011-05-17 08:57:57
代理服務器不需要認證。 – Alex 2011-05-17 08:59:17