weapp-socket-io
微信小程序的 Socket.io client 实现,压缩之后体积为 16K
为了让开发者已最低的成本上手,本类库封装了与 socket.io 一致的 API 供开发者调用。
Features
目前已支持
- Namespace
- Singleton
- Reconnect
Build
npm run build
生产环境可使用 NODE_ENV=production npm run build
进行压缩编译
How to use
拷贝 build 目录的 index.js 文件到你的项目目录,并 require
const io = require('yourPath/build/index.js')
为了 使用风格与 socket.io 完全一致
const news = news const chat = consolechat
Collaborator
TODO
- emit buffer
- Binary support
- Room的支持
- Smaller size
- Ajax style api