I want to run nodejs & socket.io server in google compute engine with https / SSL.
I installed self-signed certificate from https://cloud.google.com/compute/docs/load-balancing/http/ssl-certificates.
Now, How Do I enable nodejs server to use https protocol?
Thanks,
Below is the code, which I used for HTTPS in nodejs,
Regarding google compute engine, you just need to enable 443 port from firewall.
You need a number of things to configure a nodeJS server to use HTTPs. I would suggest Nginx (http://nginx.org/en/docs/http/configuring_https_servers.html) to set up https port 443 connections to terminate at the nginx layer. Then proxy all these connections using the proxy_pass directive in Nginx to your NodeJS server. You could use the upstream directive in Nginx as well.
You would have to do this in a non-https set up as well, since nodeJS should not be listening on the default 80 port as it is a system port, and nodeJS won't allow you to start the process unless you run as sudo (again not recommended).