Skip to content

Latest commit

 

History

History
21 lines (19 loc) · 379 Bytes

README.md

File metadata and controls

21 lines (19 loc) · 379 Bytes

eggSocket

use Egg show socket

init

npm install

dev

npm run dev

说明

客户端使用socket.io

const socket = require('socket.io-client')('http://127.0.0.1:7002')

socket.on('connect', () => {
  console.log('connect!')
  socket.emit('chat', 'hello world!')
})

socket.on('res', msg => {
  console.log('res from server: %s!', msg)
})

实现socket推送发消息