Skip to content

Instantly share code, notes, and snippets.

@diverted247
Created April 15, 2013 20:40
Show Gist options
  • Save diverted247/5391120 to your computer and use it in GitHub Desktop.
Save diverted247/5391120 to your computer and use it in GitHub Desktop.
Use of unref() via request.socket
var http = require( 'http' );
var server = http.createServer( function( request , response ) {
request.socket.unref();
console.log( request.socket.remoteAddress );
response.writeHead( 200 , { 'Content-Type' : 'text/plain' } );
response.end( 'working!' );
});
server.listen( 1492 , '127.0.0.1' );
console.log( 'Listening on http://127.0.0.1:1492' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment