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)