问题
I know it's pretty easy and possible to listen to a unix socket file in express mvc. But in sailsjs, I do not know where and how to do this due to lack of documentation.
回答1:
If you're referring to the ability of Express to bind to a Unix domain socket rather than a port, you can accomplish the same with Sails by setting the port
config, either on Sails lift:
sails lift --port=/tmp/sails.sock
or in your /config/local.js
port: '/tmp/sails.sock'
Then you could telnet /tmp/sails.sock
with Sails running to test it out!
来源:https://stackoverflow.com/questions/22394151/listen-to-unix-socket-in-sailsjs