如何在没有任何问题的情况下运行socket.io和now.js?

如何在没有任何问题的情况下运行socket.io和now.js?,socket.io,nowjs-sockets,Socket.io,Nowjs Sockets,我正在尝试运行一个应用程序,该应用程序使用socket.io实现一些功能,而nowjs实现其他一些功能?当我运行应用程序时,socket.io和socket.io会不断冲突。请建议我必须做什么? 聊天模块 WebSocket connection to 'ws://localhost:3000/socket.io/1/websocket/6gMr-tmuaA0kJnNQrIQz' failed: WebSocket is closed before the connection is estab

我正在尝试运行一个应用程序,该应用程序使用socket.io实现一些功能,而nowjs实现其他一些功能?当我运行应用程序时,socket.io和socket.io会不断冲突。请建议我必须做什么?

聊天模块

WebSocket connection to 'ws://localhost:3000/socket.io/1/websocket/6gMr-tmuaA0kJnNQrIQz' failed: WebSocket is closed before the connection is established. socket.io.js:2438
喷漆模块

WebSocket connection to 'ws://localhost:3000/socket.io/1/websocket/6gMr-tmuaA0kJnNQrIQz' failed: WebSocket is closed before the connection is established. socket.io.js:2438
我添加了绘画模型,在这种情况下,绘画模块和聊天模块的插座都会发生冲突,多次发出以下连接警告。但无法连接,但当我评论聊天模块或绘画模块时,效果良好

WebSocket connection to 'ws://localhost:3000/socket.io/1/websocket/6gMr-tmuaA0kJnNQrIQz' failed: WebSocket is closed before the connection is established. socket.io.js:2438

您不能同时运行这两个程序,因为这两个程序都试图要求socket@same port try nginx for node app

发布您的代码并说明错误,然后我们可能可以帮助您检查代码如何解决此问题这可能是由于node.js的异步性质造成的。你有没有试过把所有的代码都放在server.js文件中来运行这个程序?是的,尝试了相同的问题。我想weather nowjs和socket.io都试图获得相同的端口,这导致了这个问题。我没有完全弄清楚出了什么问题。是的,你是对的。但是nowjs似乎很长一段时间以来都没有处于积极的开发中,所以您应该寻找其他替代方案
WebSocket connection to 'ws://localhost:3000/socket.io/1/websocket/6gMr-tmuaA0kJnNQrIQz' failed: WebSocket is closed before the connection is established. socket.io.js:2438