Skip to content

bitwebs/tunnel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@web4/tunnel

Tunneling service for Bitswarm

npm install @web4/tunnel

Usage

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

License

MIT

About

Tunneling service for BitSwarm

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%