I'm looking for a way to have a socket listening for HTTP requests on a master process, then passing any incoming connections and the request data to a child process using process.send() and handling the HTTP request in the child process.
However, I'm unable to find a way to attach the passed connection and the request data to a HTTP server in the child process, without initializing the server by .listen()ing on a socket.
So, is it somehow possible to use a HTTP server to handle a connection passed in from another process? Any non-public API solution will also do (hopefully JavaScript-side, though).
I guess I could initialize the server to listen on some dummy socket and then bounce the incoming connections off of that, but that would seem suboptimal. Passing in the listening socket as well or using Cluster or a reverse proxy would also not be optimal in my case.