simple-hyperproxy

0.0.7 • Public • Published

Simple-Hyperproxy

P2P proxy built on top of Hyperswarm DHT.

npm install -g simple-hyperproxy

Requires Node version >= v14.17.0

Usage

simple-hyperproxy expose [port]
# Exposed port on key [key]
simple-hyperproxy bind key
# Binded key on port [port] 

Example

const axios = require('axios');
const SimpleHyperProxy = require('simple-hyperproxy')
const proxy = new SimpleHyperProxy()

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

server.listen(8081, '127.0.0.1', () => {
})

const key = await proxy.expose(8081)
const bindPort = await proxy.bind(key)
console.log(await axios.get('http://localhost:' + bindPort))

/simple-hyperproxy/

    Package Sidebar

    Install

    npm i simple-hyperproxy

    Weekly Downloads

    0

    Version

    0.0.7

    License

    ISC

    Unpacked Size

    5.83 kB

    Total Files

    5

    Last publish

    Collaborators

    • rafapaezbas