@quanxiaoxiao/about-http

0.2.3 • Public • Published

about-http

Install

npm install @quanxiaoxiao/about-http

Usage

import { httpConnect, httpForward , fetchData, receiveData, receiveJSON } from 'about-http';
// httpForward(options, httpResponse)
// httpConnect(options, { onError, onResponse, onData, onEnd, onClose })
// fetchData(options)
// receiveData(httpRequest, limit)
// receiveData(httpRequest, limit = 3MB)
// connectWebSocket(options, httpRequest, socket)

options

server.on('upgrade', (req, socket) => {
  if (req.url === '/ws') {
    connectWebSocket({
      url: 'wss://quan/ws',
    }, req, socket);
  } else {
    socket.destroy();
  }
});

Dependents (5)

Package Sidebar

Install

npm i @quanxiaoxiao/about-http

Weekly Downloads

1

Version

0.2.3

License

ISC

Unpacked Size

37.2 kB

Total Files

15

Last publish

Collaborators

  • quanxiaoxiao