@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

    Install

    npm i @vampyreio/vio-proxy

    DownloadsWeekly Downloads

    3

    Version

    0.0.3

    License

    Apache-2.0

    Unpacked Size

    22.3 kB

    Total Files

    20

    Last publish

    Collaborators

    • vampyre