0
Haben Sie dieses Programm:JAVA: Falsche ip als Antwort über Proxy
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");
}
Wenn ich ip in der Konsole zu bekommen, ist es nicht ip von gefassten Proxy wie ist (es ist ip meiner lokalen Station). Was habe ich falsch gemacht?
Was meinen Sie mit "Get ip in der Konsole"? – f1sh
Was ist das Ergebnis, wenn Sie auf diese URL im Browser zugreifen? –
"get ip in console" bedeutet, dass ich Respons aussieht wie {"ip": "my.local.ip.address"} das gleiche wie im Browser – Dimka