From 1b90bb2c3426f61724abb72cda3fb8229abf0787 Mon Sep 17 00:00:00 2001
From: Sandy <1013356+bwrsandman@users.noreply.github.com>
Date: Sun, 1 Mar 2026 03:34:32 -0500
Subject: [PATCH] fix: Allow access to web docker app from outside container
(#2659)
### Problem description
When trying to install imhex as a docker container using
`ghcr.io/werwolv/imhex/imhex-web`, the 9090 port doesn't connect to
anything on the host server. Connections to 9090 work inside the
container.
This is because the `localhost` address is `127.0.0.1` which does not
allow for access from outside.
### Implementation description
Change server binding from `localhost` to `0.0.0.0` to allow connections
from all interfaces, no just `lo`.
### Screenshots
Where 9090 is before and 9091 is after the change.
Before
After
### Additional things
---
dist/web/serve.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dist/web/serve.py b/dist/web/serve.py
index 26b01e2aa..8faaf7b71 100644
--- a/dist/web/serve.py
+++ b/dist/web/serve.py
@@ -10,6 +10,6 @@ class MyHttpRequestHandler(http.server.SimpleHTTPRequestHandler):
if __name__ == '__main__':
os.chdir(".")
- httpd = http.server.HTTPServer(("localhost", 9090), MyHttpRequestHandler)
+ httpd = http.server.HTTPServer(("0.0.0.0", 9090), MyHttpRequestHandler)
print(f"Serving {os.getcwd()} on http://{httpd.server_address[0]}:{httpd.server_address[1]}")
httpd.serve_forever()