A W3C-compliant webSocket object based on the weex webSocket module
yarn add weex.adapter.websocket
or
npm install weex.adapter.websocket
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')
- Develop websocket application in weex with W3C standard syntax
- Make existing libraries compatible with weex by replacing them. Such as socket.io-client