How to bind to unix sockets instead of port?
-
I would like to bind nodebb to a unix socket instead of to ports for performance reasons.
I found this post by Julian (https://github.com/NodeBB/NodeBB/issues/2497) discussing that it is indeed possible.
Can anyone share how to bind nodebb to a unix socket? What config files do I have to change?
-
Just pinging @julian because he knows best
-
@vincenttide If you change the
port
value in yourconfig.json
to the absolute path of a unix socket, NodeBB will create the socket file there and bind to it. That's all there is to it -
Thanks Julian, it works!
For anyone else that wants to do this I've attached my config.json file below:
{ "url": "http://localhost/forum", "port": "/tmp/nodeenv.sock", "secret": "random-secret-here", "database": "mongo", "mongo": { "host": "127.0.0.1", "port": "27017", "username": "", "password": "", "database": "0" } }
Copyright © 2024 NodeBB | Contributors