Skip to content

Instantly share code, notes, and snippets.

@justindarc
Created February 23, 2016 20:02
Show Gist options
  • Save justindarc/4a4ec9bf14327f944c1a to your computer and use it in GitHub Desktop.
Save justindarc/4a4ec9bf14327f944c1a to your computer and use it in GitHub Desktop.
node-mdns-http-test
var http = require('http');
var mdns = require('mdns');
const HTTP_PORT = 8000;
var server = http.createServer(function(request, response) {
response.end('Hello world!');
});
server.listen(HTTP_PORT);
var ad = mdns.createAdvertisement(mdns.tcp('http'), HTTP_PORT);
ad.start();
{
"name": "node-mdns-http-test",
"version": "1.0.0",
"main": "index.js",
"dependencies": {
"mdns": "^2.3.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment