1.2.3 • Published 3 years ago

websocket-request v1.2.3

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

websocket-request

About

Made websocket to Request response mode.

Imitate the request and response mode of HTTP, send a request and wait for the response to return.

How use

npm

npm i websocket-request --save

yarn

yarn add websocket-request -S

example

 
const WS = require("websocket-request");

async function test(){
  const ws = new WS('ws://localhost');
  await ws.open();
  let res=await ws.request('data');
  console.log(res);
}

test().then(()=>{});