Need help reading ancillary messages from unix domain socket

44 views
Skip to first unread message

prerak jain

unread,
Jun 23, 2015, 7:36:13 AM6/23/15
to nod...@googlegroups.com
I have a server which needs to run multiple process on 443 port, for that I have a proxy server which will actually listen on 443 port and based on the TLS Client Hello server name(SNI) field it forwards the socket fds to the respective process using unix domain socket ancillary messages. Is there any way in nodejs where I can fetch the socket fd from the ancillary message and create connection using it.

Sam Roberts

unread,
Jun 23, 2015, 1:05:40 PM6/23/15
to nod...@googlegroups.com

prerak jain

unread,
Jun 24, 2015, 7:27:51 AM6/24/15
to nod...@googlegroups.com
Thanks Sam for the response, but in my case the proxy server forwarding the socket fd and the nodejs are two separate processes. The apis in link you mentioned can only be used if the processes has parent-child relationship. 

mscdex

unread,
Jun 25, 2015, 10:27:48 AM6/25/15
to nod...@googlegroups.com
On Tuesday, June 23, 2015 at 7:36:13 AM UTC-4, prerak jain wrote:
I have a server which needs to run multiple process on 443 port, for that I have a proxy server which will actually listen on 443 port and based on the TLS Client Hello server name(SNI) field it forwards the socket fds to the respective process using unix domain socket ancillary messages. Is there any way in nodejs where I can fetch the socket fd from the ancillary message and create connection using it.

You would have to write a binding to do that since support for it in core was removed post-node v0.4 I think? There are a couple of small libraries[1][2] that might make it a bit easier.

[1] https://github.com/mhaberler/libancillary
[2] https://github.com/sharvil/flingfd
Reply all
Reply to author
Forward
0 new messages