Socket
Book a DemoInstallSign in
Socket

@hyperswarm/tunnel

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hyperswarm/tunnel

Tunneling service for Hyperswarm

latest
Source
npmnpm
Version
1.1.2
Version published
Maintainers
3
Created
Source

@hyperswarm/tunnel

Tunneling service for Hyperswarm

npm install @hyperswarm/tunnel

Usage

const { Remote, Local } = require('@hyperswarm/tunnel')

On a remote server run the tunneler

const r = new Remote()

r.listen(10000) // listen on port 10000

Then on a client you can start a server that's being announced

const l = new Local(10000, 'remote-server.com')

const s = l.createServer(function (socket) {
  // a remote socket ...
})

s.listen(hash(Buffer.from('a topic to announce on')))

Or a client connection

const s = l.connect(hash(Buffer.from('a topic to connect on')))

CLI

If you just want to spin up a tunneling server you can run the following cli

npm install -g @hyperswarm/tunnel
hyperswarm-tunnel-server --port 10000

License

MIT

FAQs

Package last updated on 06 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts