unix socket support
See original GitHub issueIs it possible to use express with unix socket instead of host:port
?
The listen
signature just call underlying server listen
method, so I tried with:
server = require('net').createServer(express());
server.listen('/tmp/sock', function() {
fs.chmodSync('/tmp/sock', 0777);
});
But then when, through nginx, I try to access a page, express crashes with the following error:
[...]/node_modules/express/lib/router/index.js:140
var search = 1 + req.url.indexOf('?');
^
TypeError: Cannot read property 'indexOf' of undefined
at Function.handle ([...]/node_modules/express/lib/router/index.js:140:27)
at EventEmitter.handle ([...]/node_modules/express/lib/application.js:173:10)
at Server.app ([...]/node_modules/express/lib/express.js:38:9)
at emitOne (events.js:77:13)
at Server.emit (events.js:169:7)
at Pipe.onconnection (net.js:1431:8)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Error : No unix socket support on windows connecting mongodb
I had the same issue and was able to fix it by removing the full url (for example: mongodb://myuser:mypassword@mongodb-test.mydomain.com/my_database ) in ...
Read more >UNIX domain sockets - IBM
UNIX domain sockets support both stream-oriented, TCP, and datagram-oriented, UDP, protocols. You cannot start a UNIX domain socket for raw socket protocols.
Read more >unix(7) - Linux manual page - man7.org
UNIX domain sockets support passing file descriptors or process credentials to other processes using ancillary data. Address format A UNIX domain socket ......
Read more >Unix domain socket - Wikipedia
A Unix domain socket aka UDS or IPC socket (inter-process communication socket) is a data communications endpoint for exchanging data between processes ...
Read more >Unix Sockets are Now Supported on Windows - Bozhidar Batsov
I was surprised to learn that Windows has added support for Unix sockets (AF_UNIX) a few years ago (in 2017). From the announcement...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Glad to hear you got it working! You’re absolutely welcome to make a PR to update/add to our documentation. There is a link to edit the docs and open a PR all within your web browser at the bottom of every documentation page 😃
Ok my bad … it seems rather logical to use
http
instead ofnet
. Now perhaps we need a note inlisten
documentation to mention that socket are also supported ?