NodeJS の問題に直面しています。最初は、更新を取得するまでに約 4 ~ 5 秒かかります。Node JS サーバーはパブリックにアクセス可能であり、プロキシなどを介してパッチが適用されることはありません。ただし、最初の接続が確立されると、更新は瞬時に行われます。
Chrome のネットワーク ツールを使用して深く掘り下げました - データを待機していると表示されます。添付の画像を参照してください
参考までに、私の app.js (ノード アプリケーション) のコードも貼り付けます。
var http = require('http'),
url = require('url'),
fs = require('fs'),
amqp = require('amqp'),
sys = require(process.binding('natives').util ? 'util' : 'sys');
var exchangeName = 'conferenceTest';
send404 = function (res) {
res.writeHead(404);
res.write('404');
res.end();
};
server = http.createServer(function (req, res) {
var path = url.parse(req.url).pathname;
switch (path) {
case '/':
fs.readFile(__dirname + "/index.html", function (err, data) {
if (err) {
return send404(res);
} else {
res.writeHead(200, {
'Content-Type': 'application/zip',
'Connection': 'close',
'content-encoding': 'gzip'
});
res.write(data, 'utf8');
res.end();
}
});
break;
}
});
// listen to the http server for socket connections
var io = require('socket.io').listen(server);
var connection = amqp.createConnection({
host: 'localhost'
});
connection.on('ready', function () {
var exchange = connection.exchange(exchangeName, { // create exchange
type: 'direct',
durable: true
});
io.sockets.on('connection', function (client) {
console.log("client connected");
client.on('changeview', function (data) {
var queue = connection.queue(data.queueName, { //create queue
durable: true,
autoDelete: false
});
var plaintext = "Put any kind of meat on a stick and roast it over a flame and it immediately becomes food fit for gods. No country understands this sacred rule of seared meat like Turkey.Turkish kebabs are the incarnation of the meat lovers most exotic fantasies, with grilled lamb, beef and chicken as skewer MVPs.Most kebab restaurants also have a long list of Turkish starters called meze that are as delicious as the main dishes.Turkeys best alcoholic complement for all that meat is raki -- an aniseed-flavored drink that s often diluted with water and chilled with ice. Frothy, yogurt-based ayran is a great non-alcoholic complement to heavy dishes. But who are we kidding -- you just want the meat. Heres where to get it in Turkey.";
io.sockets.emit('changeview', plaintext);
});
});
});
process.on('uncaughtException', function (err) {
console.log('Uncaught Exception: ' + err.message);
});
server.listen(18080);
ありがとう