Accessing the url protocol from the server side


Please help, I can not find a way to determine if the user is using http or https protocols to access my meteor site. On the client side I can easily just use window.location.protocol but on the server side I am having a much more difficult time.

The reason I am doing this is so I can set the ROOT_URL variable before it is used by the Oauth logins.


You can Force SSL, then you don’t need to check :smile:


The hope was to allow users to use both ssl and non-ssl. I actually found a solution that answers my exact question though. You can access the protocol using the Header ‘x-forwareded-proto’ set by meteor when accessing using https.


a bit hacky though. Wish I had a method that made me feel a little better


I would try something with