Last active
May 20, 2016 19:07
-
-
Save MylesBorins/d2a82b014d3cfe9b871bb401d11fccd4 to your computer and use it in GitHub Desktop.
Child process argv
This file contains hidden or 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
const http = require('http'); | |
const server = http.createServer((req, res) => { | |
res.end(); | |
}); | |
server.on('clientError', (err, socket) => { | |
socket.end('HTTP/1.1 400 Bad Request\r\n\r\n'); | |
}); | |
server.listen(process.argv[2]); |
This file contains hidden or 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 fork = require('child_process').fork; | |
var child = fork(__dirname + '/child.js', ['8000']); | |
var childToo = fork(__dirname + '/child.js', ['8080']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment