我遇到了一个问题,我在这里附上了我的代码。我曾尝试过设置
jdk.http.auth.tunneling.disabledSchemes =
jdk.http.auth.proxying.disabledSchemes =
在jdk1.8.0_111 / jre / lib / net.properties
中我仍然遇到同样的问题:
public static void main(String args[]) throws IOException, JSONException{
System.setProperty("https.proxyUse", "true");
System.setProperty("https.proxyHost", "192.168.1.5");
System.setProperty("https.proxyPort", "29842");
System.setProperty("https.proxyUserName", "lavan");
System.setProperty("https.proxyPassword", "lavan1234");
final URL url = new URL("https://api.ipify.org/");
final URLConnection urlConnection = url.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestProperty("Content-Type", "application/json; charset=utf-8");
urlConnection.connect();
final InputStream inputStream = urlConnection.getInputStream();
String isss = convertStreamToString(inputStream);
System.out.println(isss);
}