Created
July 15, 2012 05:33
-
-
Save Raynos/3115169 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var ports = require('seaport').connect(7000, { secret : 'beep boop' }); | |
var server = http.createServer(function (req, res) { | |
res.end('boop\n'); | |
}); | |
var server2 = http.createServer(function (req, res) { | |
if (req.url === '/beep') { | |
return server.emit('request', req, res) | |
} | |
res.end('hello cruel world\n'); | |
}); | |
ports.service('web.localhost', function (port, ready) { | |
server2.listen(port, ready); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var ports = require('seaport').connect(7000, { secret : 'beep boop' }); | |
var server = http.createServer(function (req, res) { | |
res.end('boop\n'); | |
}); | |
ports.service('web.localhost', { mount : '/beep' }, function (port, ready) { | |
server.listen(port, ready); | |
}); | |
var server2 = http.createServer(function (req, res) { | |
res.end('hello cruel world\n'); | |
}); | |
ports.service('web.localhost', function (port, ready) { | |
server2.listen(port, ready); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment