Skip to content

Instantly share code, notes, and snippets.

@rom1504
Created October 15, 2015 13:06
Show Gist options
  • Select an option

  • Save rom1504/b96629cc65d55d2b639b to your computer and use it in GitHub Desktop.

Select an option

Save rom1504/b96629cc65d55d2b639b to your computer and use it in GitHub Desktop.
bind given ipv6
var http = require('http');
var options = {
hostname: 'www.whatismyipv6.com',
localAddress: process.argv[2],
family:6
};
var req = http.request(options, function(res) {
res.on('data', function (chunk) {
console.log(chunk.toString());
});
});
req.on('error', function(e) {
console.log('ERROR: ' + e.message);
});
req.end();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment