Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在 cordova 应用程序中创建 Socket.io (websocket) 服务器?
我需要在我的 ionic 应用程序上运行 socket.io 服务器(websocket)。
谢谢
您可以借助包名ng-socket-io在 IONIC 2 中实现套接字
像这样导入包:
从'ng-socket-io'导入{套接字};
在构造函数中初始化它
然后您可以调用以下函数将其与套接字连接
this._socket.connect();
this._socket.emit('join_room', "room_name");