@vampyreio/vio-proxy
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

vio-proxy

simple proxy for http/htt2/ws with no external dependencies.

Usage

http 1

import { Http1ProxyFactory } from '../src';
import http from 'http';

// create a new proxy
const proxy = new Http1ProxyFactory().createProxyServer();

// error handling
proxy.on('error', (error) => console.log(error.message))

const server = http.createServer((req, res) => {

    // your proxy-logic logic here!
    res.setHeader('header-from-proxy', 'moo!');

    // pass object to proxy
    proxy.web(req, res, {endpoint: 'localhost', port: 3000});
});

server.listen(8080, () => console.log('server running on port 8080'));

TODO

  • Merge headers
  • Implement Websockets
  • Implement HTTP/2
  • Buy Beer

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.3
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.3
    1
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i @vampyreio/vio-proxy

Weekly Downloads

1

Version

0.0.3

License

Apache-2.0

Unpacked Size

22.3 kB

Total Files

20

Last publish

Collaborators

  • vampyre