@vampyreio/vio-proxy
v0.0.3
Published
simple proxy for http/htt2/ws
Downloads
6
Readme
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