0
Iâve previously mentioned my io-uring webserver tarweb. Iâve now
added another interesting aspect to it.
As you may or may not be aware, on Linux itâs possible to send a file
descriptor from one process to another over a unix domain socket. Thatâs
actually pretty magic if you think about it.
You can also send unix credentials and SELinux security contexts, but thatâs a
story for another day.
My goal
I want to run some domains using my webserver âtarwebâ. But not all. And I want
to host them on a single IP address, on the normal HTTPS port 443.
Simple, right? Just use nginxâs proxy_pass?
Ah, but I donât want nginx to stay in the path. After SNI (read:
âbrowser saying which domain it wantsâ) has been identified I want the TCP
connection to go directly from the browser to the correct backend.
Iâm sure somewhere on the internet thereâs already an SNI router that does
this, but all the ones I found stay in line with the request path, adding a
hop.
Why?
A few reasons:
- Having all bytes bounce on the SNI router triples the number of total file
descriptors for the connection. (one on the backend, Continue reading