liuxiaolei
liuxiaolei

Reputation: 76

Listen to unix socket in 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.

Upvotes: 2

Views: 358

Answers (1)

sgress454
sgress454

Reputation: 24948

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!

Upvotes: 3

Related Questions