Hi! Well, to run MHD with both HTTP and HTTPS-support, you need to start the daemon twice. That means you can pass a different callback or a different closure to distinguish. You could also try to get access to the TLS/SSL handle via MHD_CONNECTION_INFO_GNUTLS_SESSION, which would fail for HTTP and give you info you might want for HTTPS.
Happy hacking! Christian On 02/24/2016 01:51 AM, silvioprog wrote: > Hello listers, > > Sometimes, we need to check if the client does a request from HTTP or > HTTPS protocol, and then take a decision. In nginx I use it to redirect all > requests from HTTP URL to the HTTPS URL. > > I took a look how NodeJS does it, because it has the `protocol` property on > its request object: > > https://github.com/expressjs/express/blob/master/lib/request.js#L288 > > Does anybody know if I can do something like this with MHD? I searched some > function or flag, but I couldn't find that. > > Thank you! >
signature.asc
Description: OpenPGP digital signature
