# Getting transport and host from httpaf

**URL:** <https://discuss.ocaml.org/t/getting-transport-and-host-from-httpaf/7861>\
**Category:** Learning\
**Tags:** httpaf\
**Created:** [May 15, 2021, 11:17am UTC](https://discuss.ocaml.org/t/getting-transport-and-host-from-httpaf/7861 "2021-05-15T11:17:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jon\_Harrop](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/jon_harrop/32/2015_2.png) [@Jon\_Harrop](https://discuss.ocaml.org/u/Jon_Harrop)\
**Post date:** [May 15, 2021, 11:17am UTC](https://discuss.ocaml.org/t/getting-transport-and-host-from-httpaf/7861/1 "2021-05-15T11:17:39Z")

</div>

I’d like to redirect HTTPS to HTTP and point multiple domains at the same server and host different content on them.

When I’m serving pages using httpaf, how can i tell what transport (i.e. HTTP or HTTPS) was used and which domain (host) I’m serving?

---

<div class="post-metadata">

**Author:** ![yawaramin](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/yawaramin/32/3384_2.png) [@yawaramin](https://discuss.ocaml.org/u/yawaramin)\
**Post date:** [May 15, 2021, 5:06pm UTC](https://discuss.ocaml.org/t/getting-transport-and-host-from-httpaf/7861/2 "2021-05-15T17:06:15Z")

</div>

From httpaf’s point of view, it shouldn’t matter. The SSL termination and SNI stuff should be done by a reverse proxy like Nginx: [NGINX Docs | NGINX SSL Termination](https://docs.nginx.com/nginx/admin-guide/security-controls/terminating-ssl-http/)
