效果:
代码:
public class TestMain {
public static void main(String[] args){
HttpRequest httpRequest = HttpRequest.get("https://www.youtube.com").timeout(30000);
httpRequest.setProxy(new Proxy(Proxy.Type.HTTP,new InetSocketAddress("127.0.0.1",10809)));
String body = httpRequest.execute().body();
System.out.println(body);
}
}
如何获取代理端口:
转载自CSDN-专业IT技术社区
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/my773962804/article/details/132337839