I am using nodejs and expressjs. I wonder if there is something like request.headers.protocol in the clientRequest object. I would like to build the baseUrl for
request.headers.protocol
If you want to know whether request is http or https then use this in your code:
req.headers.referer.split(':')[0];
This will return whether req is http or https.