0
を経由して対応して誤ったIPは、このプログラムを持っている:JAVA:プロキシ
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");
}
私はコンソールのIPを取得する場合、それは(それは私のローカル局のIPです)settedプロキシのIPのようではありません。私は何を間違えたの?
「コンソールでget ip」とはどういう意味ですか? – f1sh
ブラウザでそのURLにアクセスしたときの結果はどうなりますか? –
「コンソールでIPを取得する」とは、ブラウザのように{"ip": "my.local.ip.address"}のような応答を得ることを意味します – Dimka