找不到Socket.io资源:" /socket.io/1/?t = ..."

时间:2014-05-07 22:41:20

标签: node.js sockets amazon-ec2 websocket socket.io

我正在将我的第一个node / socket.io应用程序从本地工作转换为远程工作在服务器上。


我已经启动了socket.io服务器(成功):

var socket = require("socket.io").listen(4545); 

并将客户端链接到它(成功):

<script src="http://54.186.131.77:4545/socket.io/socket.io.js"></script>

但我现在收到此错误,我不确定它的含义或解决方法:

GET http://officeball.biz/socket.io/1/?t=1399501542907 404 (Not Found) socket.io.js:1659

Socket.handshake socket.io.js:1659
Socket.connect socket.io.js:1699
Socket socket.io.js:1551
io.connect socket.io.js:94
(anonymous function) client.js:257

client.js:257是:

var socket = io.connect();

It seems to be a common scenario


找不到此资源的原因是什么?

1 个答案:

答案 0 :(得分:0)

尝试使用socket = io.connect(http://54.186.131.77:4545);