user128511
user128511

Reputation:

How to detect http vs https from an Http.IncomingMessage in node.js

Given an Http.IncomingMessage created by an http(s).Server in response to a request what's the correct / recommended way to detect if the request is http vs https?

Some random ideas that I have no idea are correct

Upvotes: 8

Views: 2710

Answers (1)

robertklep
robertklep

Reputation: 203534

req.socket will have a property called encrypted set to true for HTTPS connections.

Upvotes: 7

Related Questions