ql-io / cluster2

A node.js (>= 0.8.x) compatible multi-process management module
http://ql-io.github.com/cluster2/
Other
280 stars 35 forks source link

SSL Support? #34

Open dakami opened 11 years ago

dakami commented 11 years ago

Not obvious how to SSL-ize an express connection. Any tips?

shimonchayim commented 11 years ago

Hi dakami, I agree an example will help. Cert, etc will be configured in express because all c2 does is listen on the provided ports to serve the app. But will try to put together an example.

dakami commented 11 years ago

Much appreciated. This is actually the best way to make Node multi-core right now (congratulations), so your reward for excellent work is more work.

shimonchayim commented 11 years ago

This info may be helpful. http://stackoverflow.com/questions/11804202/how-to-setup-a-ssl-cert-in-express-js-server-now

alumowa commented 11 years ago

This might be more trouble than it's worth but it would actually be pretty neat to be able to support http & https apps at the same time for those who wants to secure portions of their site. Looking at the source it seems rather iffy to stuff that support in though, any ideas?

shimonchayim commented 11 years ago

C2 only listens on the ports provided to server the app(s) (again provided by user). If express, etc server is configured with certificates then I am not sure if anything needs to be done in C2.

dakami commented 11 years ago

Cluster2 only listens on one port (well, it also listens on Monitor, but that's a bug). I could run two clusters, even going so far as to dual-process each core, but then I'm posting sessions to the same express app. If I have two apps, one with and one without ssl, I need to double configure both apps to have all the routing wired up.

What I want is a hook that says, if the app saw its comms come in from SSL, then use this SSL config but otherwise be normal.

shimonchayim commented 11 years ago

Cluster2 can run on as many ports as you like. We need to update the doc but we have recently made changes were you can can pass Express App and port pair and cluster2 will serve them. Here is an example: https://github.com/ql-io/netmorphic-template/blob/master/index.js

On Fri, Mar 1, 2013 at 4:32 PM, dakami notifications@github.com wrote:

Cluster2 only listens on one port (well, it also listens on Monitor, but that's a bug). I could run two clusters, even going so far as to dual-process each core, but then I'm posting sessions to the same express app. If I have two apps, one with and one without ssl, I need to double configure both apps to have all the routing wired up.

What I want is a hook that says, if the app saw its comms come in from SSL, then use this SSL config but otherwise be normal.

— Reply to this email directly or view it on GitHubhttps://github.com/ql-io/cluster2/issues/34#issuecomment-14319249 .