Skip to content

quanxiaoxiao/about-http

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:https://quan/ws',
    }, req, socket);
  } else {
    socket.destroy();
  }
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages