emikulic / darkhttpd

When you need a web server in a hurry.
https://unix4lyfe.org/darkhttpd/
ISC License
1.03k stars 83 forks source link

With `--forward-https` set `client` ip from `X-Forwarded-For` #49

Open itoffshore opened 6 months ago

itoffshore commented 6 months ago

When darkhttpd knows it's behind a proxy (--forward-https) - it makes more sense for logging purposes to set the client ip from a header rather than the source ip address of the connection.

So that these changes are a one time event - the following changes should be sufficient:

If --forward-https is enabled:


Slightly OT - darkhttpd worked perfectly in a rootless podman pod behind caddy. Your docker container is also very nice with no shell / no users / no other binaries

emikulic commented 6 months ago

Yeah, this is reasonable. I'd be willing to merge a patch that did this.


The docker container is thanks to @miles-po and @kugland - thanks, folks!