@dswarm/tunnel

1.0.0 • Public • Published

@dswarm/tunnel

Tunneling service for DSwarm

npm install @dswarm/tunnel

Usage

const { Remote, Local } = require('@dswarm/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 @dswarm/tunnel
@dswarm/tunnel-server --port 10000

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @dswarm/tunnel

Homepage

dwebx.org

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

6.64 kB

Total Files

5

Last publish

Collaborators

  • dwebprotocol