第一次然后我运行web服务器我的主页加载大约25秒然后我删除这一行:
<script src="/socket.io/socket.io.js" type="text/javascript"> </script>
我的网页工作正常。那么为什么socket.io这么慢?
var app = express()
, server = require('http').createServer(app)
, io = require('socket.io').listen(server);
io.enable('browser client minification'); // send minified client
io.enable('browser client etag'); // apply etag caching logic based on version number
io.set('log level', 1); // reduce logging
io.set('transports', [
'websocket'
, 'flashsocket'
, 'htmlfile'
, 'xhr-polling'
, 'jsonp-polling'
]);