nodejs利用socket搭建聊天服务器
-
git clone https://github.com/wqs2017/-nodejs-.git
-
node index.js
-
将index.html中的监听地址改为你本机的ip地址 (this.socket = io.connect('ws://您的本机ip:3000');)
-
打开index.html或者访问 本机访问 localhost:3000/socket 其他电脑访问:本机ip:3000/socket 输入昵称后即可开始聊天