The inside-out web server. > Turn your browser tab into a file host.
Browserver is a "reverse" web server. Instead of hosting files on a cloud server, the server acts as a tunnel. The browser itself reads files from your local disk (via the File System Access API) and streams them to the public web in real-time.
- The Hub: You run a lightweight FastAPI server (the "Tunnel").
- The Admin: You visit the admin page and select a local folder using the native Directory Picker.
- The Tunneling: The browser establishes a Server-Sent Events (SSE) connection to the Hub.
- The Magic: When an outsider requests
http://server/cool-slug/image.png:- The Hub pauses the request.
- The Hub pings your Browser via SSE: "I need image.png".
- Your Browser reads the file from disk and uploads it.
- The Hub unpauses the request and serves the file.
- Python 3.11+
- uv
-
Clone or create the project: Ensure your directory looks like this:
browserver/ ├── main.py # The FastAPI Hub ├── pyproject.toml # Dependencies └── client/ └── index.html # The "Server" Logic -
Run with one command: Browserver uses
uvto handle virtual environments and dependencies automatically.uv run uvicorn main:app --reload
-
Become the Server:
- Open your browser to
http://localhost:8000. - You will be redirected to a unique session (e.g.,
/admin/happy-otter). - Click "Select Directory to Host" and grant permission.
- Open your browser to
-
Test it:
- Click the Public Link generated on the page.
- Any file in your selected folder is now accessible via that URL!
Defined in pyproject.toml:
- FastAPI: The web framework.
- Uvicorn: The ASGI server.
- SSE-Starlette: For real-time signaling to the browser.
- Coolname: For generating readable slugs (e.g.,
brave-lion).
- HTTPS Required: The File System Access API is a powerful feature. Browsers only allow it on secure contexts (HTTPS) or
localhost. If you deploy themain.pyhub to a public server (like AWS or Heroku), you must use HTTPS (SSL), or the "Select Directory" button will do nothing. - Tab Must Stay Open: Since the browser is the file server, closing the tab kills the site.
- Read-Only: This implementation allows the public web to read your files, but currently does not support writing back to your disk (though the API supports it).
MIT. Go wild.