Socket.io的WebSocket基礎



在本視頻中,我們將學習如何使用Socket.io和Node.JS設置Web套接字在客戶端和伺服器之間進行通信。

我們將在DigitalOcean提供的實時VPS伺服器上託管套接字,以便我們的項目可以從全球Internet上進行。

轉到https://howcode.org了解更多!

鏈接到DigitalOcean:http://howco.de/d_ocean

鏈接到howCode Facebook:http://howco.de/fb
鏈接到howCode Twitter:http://howco.de/twitter
鏈接到/r/howCode:http://howco.de/reddit

別忘了訂閱更多! 。

11 comments
  1. to "broadcast" with socket.io the usage of io.sockets.emit will just send a packet to all the clients, it's not really a broadcast. To send to all clients except the sender, use socket.broadcast.emit('message', "this is a test");

Comments are closed.