weex.adapter.websocket

2.0.1 • Public • Published

weex.adapter.websocket

A W3C-compliant webSocket object based on the weex webSocket module

Installation

yarn add weex.adapter.websocket

or

npm install weex.adapter.websocket

How to use

var Websocket = require('weex.adapter.websocket')
var ws = new WebSocket('wss://<doman>:<port>')
ws.onopen = function(){}
ws.addEventListener('open',function(){})
ws.onmessage = function(e){}
ws.onclose = function(){}
ws.send('hello word')

When is it used?

  • Develop websocket application in weex with W3C standard syntax
  • Make existing libraries compatible with weex by replacing them. Such as socket.io-client

Some products

Reference materials

Package Sidebar

Install

npm i weex.adapter.websocket

Weekly Downloads

4

Version

2.0.1

License

MIT

Unpacked Size

4.35 kB

Total Files

4

Last publish

Collaborators

  • lincwong