Listen to unix socket in sailsjs

雨燕双飞 提交于 2019-12-24 03:25:53

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!