Accessing the url protocol from the server side


#1

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.


#2

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


#3

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.


#4

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


#5

I would try something with http://docs.meteor.com/#/full/meteor_onconnection