2009-04-29 2 views
1

안전한 웹 페이지 데이터를 읽고 싶습니다. https://www.paypal.com이라고 말하면 프록시를 사용하고 있습니다. 나는 시도했다.프록시 웹 뒤에 https 웹 페이지 데이터 읽기

System.setProperty("java.net.useSystemProxies","true"); 
System.setProperty("htttps.proxyHost","myproxyhost"); 
System.setProperty("https.proxyPort","443"); 

URL u = new URL("https://www.paypal.com"); 
URLConnection uc = u.openConnection(); 
uc.setDoOutput(true); 

StringBuffer sbuf=new StringBuffer(); 
BufferedReader in = new BufferedReader(
new InputStreamReader(uc.getInputStream())); 

String res = in.readLine(); 
System.out.println(" Response from paypal "+res); 
while ((res = in.readLine()) != null){ 
     sbuf.append(res).append(","); 
} 
in.close(); 

System.out.println(" Total Data received "+sbuf); 

항상 UnknownHostException을 받고 있는데, http 웹 사이트에서 데이터를 성공적으로 가져오고있다. 내가 놓친 게 있니?

덕분에, Rohit

답변

4

당신은 즉 당신이 htttps보다는 https를 사용하여 proxyHost 설정에서 3 개 T의의를 가지고있다.

+0

잡기. ___ –