1
我试图做一个socket.io节点聊天室应用
我的dependices是
[email protected]
[email protected] 在客户端我加入Socket.IO命名空间将无法正常工作
window.onload = function(){
+ var socket = io.connect('http://localhost:4000/chat');
var messagesElement = document.getElementById('messages');
var lastMessageElement = null;
而在服务器端,我添加
- io.sockets.on('connection',function(socket){
+ io.of('/chat').on('connection',function(socket){
这些更改之前的应用程序工作正常
当我正尝试在服务器 和客户端上使用socket.io命名空间来分隔
不同的应用程序。
它不起作用,我没有找到控制台上的任何错误或错误。
My application's repository link