0
aracılığıyla yanıt olarak yanlış ip bu programı Var: i konsolda ip aldığınızda, söz konusu setted proxy ip gibi değildirJAVA: vekil
public static void main(String[] args) {
System.setProperty("http.proxyHost", "177.40.136.238");
System.setProperty("http.proxyPort", "8080");
// Next connection will be through proxy.
try {
URL oracle = new URL("http://ip.jsontest.com/");
while (true) {
URLConnection yc = oracle.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(
yc.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
}
} catch (IOException e) {
e.printStackTrace();
}
// Now, let's 'unset' the proxy.
System.clearProperty("http.proxyHost");
}
(benim yerel istasyonun ip olduğu). Neyi yanlış yaptım?
"Konsolda ip al" ile ne demek istiyorsun? – f1sh
Tarayıcıda bu URL'ye eriştiğinizde sonuç nedir? –
"Konsolda ip elde et" demek, yanıtın {"ip" gibi gözüktüğü anlamına gelir: "my.local.ip.address"} tarayıcıda olduğu gibi aynı – Dimka