1

Node.js を介してページをロードする際に大きな問題があります。これは私の Node.js アプリケーションのコードです。他のリソース (www.google.com など) を読み込もうとすると動作することに注意してください。質問はドメイン名 www.egopay.com に固有のものです。

 var http = require('http');
 var options = {
    hostname: 'www.egopay.com',
    port: 80,
    path: '/',
    method: 'GET'
};

var req = http.request(options, function(res) {
    console.log('STATUS: ' + res.statusCode);
    console.log('HEADERS: ' + JSON.stringify(res.headers));
    res.setEncoding('utf8');
    res.on('data', function (chunk) {
        console.log('BODY: ' + chunk);
    });
});

req.on('error', function(e) {
    console.log('problem with request: ' + e.message);
});

// write data to request body
req.write('data\n');
req.write('data\n');
req.end();

cURL を使用すると動作しますが、Node.js は動作しません。

リクエストの約 1 分後、次のエラーが表示されます。

problem with request: read ECONNRESET
4

2 に答える 2