Skip to content

benzlokzik/singlefile-webserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌐 Singlefile Web Server

Python 3.9+ Stdlib only Single file Asyncio License GPLv3

This is a simple web server that serves with a single file ⚑️

✨ Features

  • πŸš€ Has no dependencies
  • πŸ“‚ Renders HTML for folders/directories
  • πŸ“ Renders Markdown
  • ⚑️ Asynchronous
  • 🌚 Dark and 🌞 light themes

πŸ› οΈ How to Run

  • 🌍 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

βœ… Compatibility

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() uses getifaddrs() via ctypes first, then falls back to _ips_via_udp_probe().
  • Python 3.9+ is required by the current implementation because it uses pathlib.Path.is_relative_to().
  • This table describes the LAN IP discovery path used for startup URL printing, not basic file serving alone.

πŸ“‹ TODO

  • πŸ› οΈ Build binaries
  • 🧠 Optimize render, add more markup languages
  • πŸ“₯ Add download availability via compressed/archive files (e.g., .zip, .tar.gz)

About

Python 🐍 from-scratch file webserver 🌐 without any dependencies πŸš€ except Python 🐍 (with good page render 🎨)

Topics

Resources

License

Stars

8 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages