librespeed / speedtest

Self-hosted Speed Test for HTML5 and more. Easy setup, examples, configurable, mobile friendly. Supports PHP, Node, Multiple servers, and more
https://librespeed.org
GNU Lesser General Public License v3.0
12.24k stars 2.2k forks source link

Librespeed shows internal docker IP instead of public IP. #615

Open jzbor opened 6 months ago

jzbor commented 6 months ago

Description

I am hosting my own librespeed instance. I would expect the site to show my public IP address, but instead it seems to show the internal docker address.

Server

Latest Docker image; Behind a Caddy reverse proxy.

Screenshots

image

zypA13510 commented 6 months ago

You can configure your reverse proxy to pass the remote IP via headers, e.g. X-Forwarded-For: or X-Real-IP:.

jzbor commented 6 months ago

According to Caddy documentation this header is set by default.

jzbor commented 6 months ago

This is very interesting: While it shows the internal IP on my phone and laptop it works just fine on my desktop (using the same Firefox version as my laptop)

buddhaCode commented 2 months ago

I found somewhere, that the docker container must run on network mode "host". Has something to do with the NAT which uses internally.