Hosting several sites on the same host

Côme Chilliet come at chilliet.eu
Wed Dec 2 10:17:41 GMT 2020


Hello,

I’m lost with how sockets and TLS works, how can I host several gemini sites on the same host?

I cannot read the request before setting up TLS, but I need to know which hostname is requested to serve the correct certificate.

So I guess either:
1) It’s possible to have several programs listen on the same port using different hostname?
2) It’s possible for a program which listen on a port to know which hostname was requested before TLS handshake?

I use stream_socket_server and stream_socket_accept in PHP and did not find how to get requested hostname.

I did not find good documentation on the purpose of the target in the socket name. I use tcp://[::]:1965 currently.
I do not understand what it does to put a hostname instead of [::] in there.

Côme




More information about the Gemini mailing list