在Sails.js中监听Unix套接字 [英] Listen to unix socket in sailsjs

查看:40
本文介绍了在Sails.js中监听Unix套接字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道在express mvc中监听unix套接字文件非常容易并且可能.但是在sailsjs中,由于缺乏文档,我不知道在何处以及如何执行此操作.

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.

推荐答案

如果您指的是Express绑定到Unix域套接字而不是端口的功能,则可以通过设置 port 配置,可以在Sails升降机上进行:

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

或您的/config/local.js

port: '/tmp/sails.sock'

然后,您可以在运行Sails的情况下 telnet/tmp/sails.sock 进行测试!

Then you could telnet /tmp/sails.sock with Sails running to test it out!

这篇关于在Sails.js中监听Unix套接字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆