- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的应用程序在一段时间后崩溃并出现以下错误:
{ Error: connect ETIMEDOUT 31.13.92.51:443 at Object.exports._errnoException (util.js:1018:11) at exports._exceptionWithHostPort (util.js:1041:20) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14) code: 'ETIMEDOUT', errno: 'ETIMEDOUT', syscall: 'connect',
address: '31.13.92.51', port: 443 }{ Error: socket hang up at createHangUpError (_http_client.js:253:15) at TLSSocket.socketCloseListener (_http_client.js:285:23) at emitOne (events.js:101:20) at TLSSocket.emit (events.js:188:7) at _handle.close (net.js:497:12) at TCP.done [as _onclose] (_tls_wrap.js:332:7) code: 'ECONNRESET' }
我没有发现我的代码有任何问题,我该如何处理这个错误?
try {
https.get('https://www.instagram.com/'+username+'/?__a=1', function(resp){
var body = '';
resp.setEncoding('utf8');
resp.on('data', function (chunk) {
body += chunk;
});
resp.on('end', function () {
try {
var json = JSON.parse(body);
} catch (error) {
callback('Unable to fetch user info from Instagram.', null);
return;
}
callback(null, json.user);
});
});
}catch (error){
callback("Connection to Instagram failed.", null);
}
最佳答案
我尝试了与 https
模块相同的方法,我遇到了同样的问题,所以我决定使用另一个模块,即 request
模块,它似乎工作正常。我不知道为什么,但 https
无法从 instagram.com
获取响应,正如我已经尝试过的那样。这是你可以尝试的,因为它对我有用。安装请求
模块
var request = require("request");
var ext = '/?__a=1';
var username = //username here;
request
.get('https://www.instagram.com/'+ username + ext)
.on('response', function(response) {
console.log(response.statusCode) // 200 is what I get from request
console.log(response.headers['content-type'])
})
关于javascript - 错误: socket hang up using https,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45804280/
我有一个非常奇怪的问题,到目前为止我无法调试......问题是......我的应用程序需要下载一些东西才能工作。因此,在 onCreate() 方法的开头,我检查是否已经下载了某些内容。如果没有,我会
我编写了一个基于尝试解决骑士之旅问题的程序。我相信我已经想出了一个合适的解决方案,一切看起来都很好。 我很好奇的一个小问题是一小段代码实现了基于展望 future 可能的方 block 的最佳着法。
我有一段很长的java代码,它使用selenium webdriver和firefox来测试我的网站。如果我不能在这里复制它,请原谅我。它有一个无限的 while 循环来重复执行其功能。这就是它应该做
def retCursor(): host = "localhost" user = "disappearedng" db = "gupan_crawling3" co
与设计师相比,我更像是一名网络程序员,但目前我的工作要求我了解更多关于网页设计的知识。对不起,如果这个问题对专业人士来说太天真了。 在这个问题上卡了几个小时,不知道该怎么办... 请到我的博客查看底部
这是我的源代码: #include using namespace std; int main() { int numBoxes, // Number of boxes
我想要标记单词组的标签,其中: 标签在词组的左边 文字是用线括起来的,标签不是 文字缩进,标签不缩进 这里有一些东西会产生错误的格式。左侧边界应用于::before 生成的文本,缩进也应用于::bef
我运行了几个 python 子进程来将数据迁移到 S3。我注意到我的 python 子进程经常下降到 0%,并且这种情况持续超过一分钟。这会显着降低迁移过程的性能。 这是子流程的图片: 子进程执行以下
编辑:其他容器正常运行。 docker run hello-world 工作正常。 我正在尝试运行最新的 nginx docker 镜像。它无限期地挂起。我已经在 2 个单独的全新安装的 ubuntu
大家好,我要脱发了。我有一个试图连接到服务器的客户端,一切似乎都很好,使用 gethostbyname() , socket() , bind() ,但是当试图 connect()它只是卡在那里,服务
我正在尝试通过驱动器映射在远程服务器上运行批处理文件,如下所示,但进程挂起...... Enable-WSManCredSSP -Role Client -DelegateComputer somes
我刚开始使用 postman 。我在执行集合运行程序时遇到了这个错误“错误:套接字挂断”。我已经阅读了一些关于套接字挂断的帖子,它提到了发送请求并且服务器端没有响应并且可能超时。如何在 Postman
我正在 http 请求函数内调用异步函数。被调用的异步函数执行另一个 http 请求,但该 http 请求抛出错误 错误:套接字挂起 代码 var http = require("http")
我之前使用 arraylist 作为结构,但在这段代码中它不起作用。由于我找不到错误,有人可以帮助我吗? (我确信这是我的错误,但 IDE 没有说什么) 流程:首先是类(class)游戏。我调用 ru
我有一个简单的套接字服务器(用于 HL7 通信)。当它在生产中运行时间较长时,套接字线程会挂起并消耗大量 CPU 时间。 这是监听器线程的相关代码(缩短): public void run() {
我想使用以下代码创建一个信号量计数器: union semun arg_assistant; int max_ass = atoi(argv[1]); printf("Num massimo di a
我正在尝试让我的模型迁移到我正在使用的 postgress 数据库,该数据库在本地托管,我确认它已正常运行。 当我运行 sequelize db:migrate 时,它说 Loaded configu
有人知道为什么 IMemAllocator:GetBuffer 的任何原因吗? (Directshow) 挂起,除了所有正在使用的样本? 我有一个使用 GMFBridge by Geraint Dav
我一直在尝试使用 Java 的 ProcessBuilder 在 Linux 中启动一个应该“长期”运行的应用程序。该程序运行的方式是启动一个命令(在本例中,我正在启动一个媒体播放应用程序),允许它运
我需要获取一个文件列表,将它们修剪到目录路径并返回一个不同的列表。在某些情况下,这可能会处理超过 500 万个文件。 我遇到了一个问题,即核心进程因 CPU 使用率 0% 而挂起,原因我无法确定。 v
我是一名优秀的程序员,十分优秀!