System.getProperties().put("proxySet", "true"); System.getProperties().put("proxyHost", "172.31.170.14"); System.getProperties().put("proxyPort", "8080");如果上面的不行,用下面这段:
System.getProperties().setProperty("http.proxyHost", Const.proxyHost); System.getProperties().setProperty("http.proxyPort", ""+Const.proxyPort);