1.0.0 • Published 9 years ago

utun v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

utun

Create a utun (userspace network tunnel) interface from node

npm install utun

build status

Usage

var utun = require('utun')
var ip = require('ip-packet')

var tunnel = utun()

tunnel.on('message', function (message) {
  // message is a raw IP packet
  console.log(ip.decode(message))
  // lets just echo it back so ping works
  tunnel.send(message)
})

If you run the above code (as root) you should be able to see a new utun0 device in ifconfig and ping the device by doing ping 10.114.0.49

This has currently only been tested on OSX Yosemite. YMMV.

License

MIT