GithubHelp home page GithubHelp logo

gaecom / weapp.socket.io Goto Github PK

View Code? Open in Web Editor NEW

This project forked from weapp-socketio/weapp.socket.io

1.0 2.0 0.0 291 KB

A WebSocket client for building WeChat Mini Program implement by socket.io

Home Page: http://weappsocket.matong.io

License: MIT License

JavaScript 100.00%

weapp.socket.io's Introduction

A WebSocket client for building WeChat Mini Program implement by socket.io

Feature

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

  • send message queue
  • auto reconnect
  • ping, pong
  • room, namespaces

Demos

Official Framework , Wepy Framework

Install

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

$ npm install 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

# development mode
$ npm run build-dev

# production mode
$ 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('https://socket-io-chat.now.sh')

socket.on('connect', () => {
  console.log('connection created.')
});

socket.on('new message', d => {
  const {
    username,
    message
  } = d;
  console.log('received: ', username, message)
});

socket.emit('add user', "Jack");

API

See socket.io-client API

TODO

  • AliPay Mini Program
  • Lark(飞书) Mini Promram

Contributing

用户信息征集

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

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

weapp.socket.io's People

Contributors

gongzili456 avatar

Stargazers

 avatar

Watchers

 avatar  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.