Giter VIP home page Giter VIP logo

weapp.socket.io's Introduction

logo

NPM version GitHub forks GitHub stars GitHub license GitHub issues

weapp.socket.io is a client live in Wechat mini program environment based-on socket.io and full features to socket.io-client a browser version.

Feature

Full feature socket.io style implemented, based-on [email protected] version

NOTE: Only support websocket transport, removed polling transport.

Demos

Weapp Demo

Wepy Demo

Install

If you use a third-party framework such as wepy, you should install via npm

  npm i weapp.socket.io

Or if you use the native way to write code,I recommend using git clone

  git clone https://github.com/10cella/weapp.socket.io

  npm run build

  cp path/weapp.socket.io/dist/weapp.socket.io.js path/your_weapp_dir

Usage

code style is same to socket.io-client

const io = require('./yout_path/weapp.socket.io.js')

const socket = io('http://localhost:8000')

socket.on('news', d => {
  console.log('received news: ', d)
})

socket.emit('news', { title: 'this is a news' })

API

See socket.io-client API

TODO

  • AliPay mini program support

Contributing

用户信息征集

如果你的项目正在使用 weapp.socket.io 欢迎留下你的项目信息(名称,Logo,官网等)

可以在 这个 Issue 提交您的项目信息

weapp.socket.io's People

Contributors

gongzili456 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.