简体   繁体   中英

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? (eg /var/tmp/http.sock). I want to use it in combination with WebSockets and a reverse proxy.

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');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM