Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node.js-http: listen on local unix pipe/socket

Is there a possibility to listen a node.js-http server natively on a local unix pipe/socket? (e. g. /var/tmp/http.sock). I want to use it in combination with WebSockets and a reverse proxy.

like image 938
The Wavelength Avatar asked Feb 01 '13 21:02

The Wavelength


1 Answers

Because http is based on net, you can use the same options that the net module has. In fact, the http docs explicitly say that you can listen on a unix socket.

var server = http.createServer();
server.listen('/var/tmp/http.sock');
like image 63
josh3736 Avatar answered Oct 11 '22 16:10

josh3736