wzx155 最近的时间轴更新
wzx155

wzx155

V2EX 第 489744 号会员,加入于 2020-05-15 19:05:22 +08:00
写数据字典有什么好用的软件吗?
数据库  •  wzx155  •  147 天前  •  最后回复来自 weixiangzhe
3
小白求助-struts1 升级 2 问题
问与答  •  wzx155  •  184 天前  •  最后回复来自 qiguai2017
3
有大佬会用 Java 获取 steam 用户的库存吗?
程序员  •  wzx155  •  263 天前  •  最后回复来自 l0s7r
4
2021 届应届生求 Java 方面的工作,最好是游戏相关。
求职  •  wzx155  •  302 天前  •  最后回复来自 w3cfed
9
wzx155 最近回复了
185 天前
回复了 wzx155 创建的主题 问与答 小白求助-struts1 升级 2 问题
@vicalloy 没办法😣,公司领导叫
237 天前
回复了 duozhuayu 创建的主题 酷工作 [社招/校招] 多抓鱼 2021 春季抓人
可以远程笔试面试吗?
@rabbirbot00

大佬我买了个国外的 ip 设置了代理,连接到是不超时了,现在又 Connection reset 了

package com.example.demo;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.client.ResponseHandler;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.ResponseEntity;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

@SpringBootTest
class DemoApplicationTests {
@Test
public void testGet1() {
CloseableHttpClient closeableHttpClient = HttpClients.createDefault();
String urlStr = "https://steamcommunity.com/profiles/76561198426206369/inventory/json/730/2";
HttpGet httpGet = new HttpGet(urlStr);
httpGet.addHeader("User-Agent" ,"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36 Edg/89.0.774.45");
ResponseHandler responseHandler;
String ip = "150.109.186.75";
int port = **;
HttpHost proxy = new HttpHost(ip, port);
RequestConfig requestConfig = RequestConfig.custom().setProxy(proxy).build();
httpGet.setConfig(requestConfig);
CloseableHttpResponse response = null;
try {
response = closeableHttpClient.execute( httpGet);
HttpEntity entity = response.getEntity();
String s = EntityUtils.toString(entity, StandardCharsets.UTF_8);
System.out.println(s);
EntityUtils.consume(entity);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (closeableHttpClient != null) {
try {
closeableHttpClient.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (response != null) {
try {
response.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}


2021-03-12 18:29:08.185 INFO 17188 --- [ main] o.apache.http.impl.execchain.RetryExec : I/O exception (java.net.SocketException) caught when processing request to {tls}->http://150.109.186.75:**->https://steamcommunity.com:443: Connection reset
2021-03-12 18:29:08.185 INFO 17188 --- [ main] o.apache.http.impl.execchain.RetryExec : Retrying request to {tls}->http://150.109.186.75:6396->https://steamcommunity.com:443
2021-03-12 18:29:08.280 INFO 17188 --- [ main] o.apache.http.impl.execchain.RetryExec : I/O exception (java.net.SocketException) caught when processing request to {tls}->http://150.109.186.75:**->https://steamcommunity.com:443: Connection reset
2021-03-12 18:29:08.280 INFO 17188 --- [ main] o.apache.http.impl.execchain.RetryExec : Retrying request to {tls}->http://150.109.186.75:6396->https://steamcommunity.com:443
2021-03-12 18:29:08.382 INFO 17188 --- [ main] o.apache.http.impl.execchain.RetryExec : I/O exception (java.net.SocketException) caught when processing request to {tls}->http://150.109.186.75:**->https://steamcommunity.com:443: Connection reset
2021-03-12 18:29:08.382 INFO 17188 --- [ main] o.apache.http.impl.execchain.RetryExec : Retrying request to {tls}->http://150.109.186.75:6396->https://steamcommunity.com:443

java.net.SocketException: Connection reset
@rabbirbot00
为什么我开 fq 软件后浏览器可以并收到返回的获取数据,但是在 java 项目中连接超时呢?
@onecold126 我明年 3 月份都不一定实训结束呢,有可能得到 4 月份,如果不考研的话可以今年 8-11 去实训,我选的考研,学到现在感觉没大希望,同时给几明年去实训又影响春招了,所以想现在赶紧联系一个工作啊。
@hyv1001 应届生要吗?
关于   ·   帮助文档   ·   API   ·   FAQ   ·   我们的愿景   ·   广告投放   ·   感谢   ·   实用小工具   ·   2777 人在线   最高记录 5497   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 20ms · UTC 11:59 · PVG 19:59 · LAX 03:59 · JFK 06:59
♥ Do have faith in what you're doing.