Commits


don't log errno, it's always zero after libtls returns The libevent error value is much more interesting! see github issue #13


improve proxy error path properly release everything when during client_close if the request was managed by a proxy.


always mark requests as done when their code is != 20


fix comment


bail out of client_read if we've already decide what to do libevent2 can still somehowe call client_read even in code paths that never enable reading from the evbuffer. Can't reproduce on the libevent in base on OpenBSD. It's a bit ugly, but it's a small workaround for something that otherwise *always* make gmid crash when linked against libevent2. (client_read works under the assumption that c->host != NULL, matched_proxy crashes otherwise.)


tweak comment


add missing prototype


add `require client ca' for proxy blocks refactor the code that calls validate_against_ca into an helper function to reuse it in both apply_require_ca and (optionally) in apply_reverse_proxy.


proxy: allow multiple proxy blocks, matching options and validations as a side effect the order of the content of a server block is relaxed: options, location or proxy blocks can be put in any order.


allow to disable TLS when proxying requests


simplify the proxying code it doesn't make any sense to keep the proxying info per-location: proxying only one per-vhost. It can't work differently, it doesn't make sense anyway.


support optional client certificate for proxy rule


typo


add ability to proxy requests Add to gmid the ability to forwad a request to another gemini server and thus acting like a reverse proxy. The current syntax for the config file is server "example.com" { ... proxy relay-to host:port } Further options (like the use of custom certificates) are planned. cf. github issue #7


relax the "wont proxy request" check: don't check the port number Don't refuse to serve the request if the port number doesn't match the one we're listening on, as initially suggested by Allen Sobot. Complex setup may have a gmid instance reachable from multiple ports and the meaning of the check in the first places was to avoid tricking clients into thinking that we're serving for those domains: the port number is way less important than the schema or domain name. In the long run, the best way would probably to add a `listen on' keyword for the servers blocks, just like OpenBSD' httpd, but gmid can't listen on multiple ports/interfaces yet