This is a simple web server that serves with a single file ⚡️
- 🚀 Has no dependencies
- 📂 Renders HTML for folders/directories
- 📝 Renders Markdown
- ⚡️ Asynchronous
- 🌚 Dark and 🌞 light themes
-
🌍 From Web (always latest version)
curl -LsSf https://raw.githubusercontent.com/benzlokzik/singlefile-webserver/refs/heads/main/server.py | python3 -
💻 From Code
python3 server.py
| Platform | ctypes |
find_library("c") |
getifaddrs |
Result |
|---|---|---|---|---|
| 🍎 macOS | stdlib 3.9+ |
/usr/lib/libc.dylib ✅ |
BSD API ✅ | ✅ |
| 🐧 Linux (glibc) | stdlib 3.9+ |
libc.so.6 ✅ |
glibc 2.3+ ✅ |
✅ |
| 🤖 Android / Termux | stdlib 3.9+ |
libc.so ✅ |
Bionic API >= 24 |
✅ on modern devices |
| 🐡 FreeBSD / OpenBSD | stdlib 3.9+ |
libc via system lookup ✅ | BSD API ✅ | ✅ |
| 🪟 Windows | stdlib 3.9+ |
no POSIX libc path | getifaddrs unavailable ❌ |
↪ UDP fallback |
🕰️ Android < 7.0 |
stdlib 3.9+ |
libc.so ✅ |
unavailable / too old ❌ | ↪ UDP fallback |
| 🚫 Any platform | 3.8 and older |
n/a | n/a | ❌ unsupported by current code |
Notes:
_network_ips()usesgetifaddrs()viactypesfirst, then falls back to_ips_via_udp_probe().- Python
3.9+is required by the current implementation because it usespathlib.Path.is_relative_to(). - This table describes the LAN IP discovery path used for startup URL printing, not basic file serving alone.
- 🛠️ Build binaries
- 🧠 Optimize render, add more markup languages
- 📥 Add download availability via compressed/archive files (e.g.,
.zip,.tar.gz)