xend is a zero-config file server for developers, tinkerers, and anyone who needs to quickly share a local directory over HTTP. It pairs perfectly with systems like Cloudflare Tunnel, letting you securely expose a local folder to the internet.
My motivation was to experiment with Cloudflare tunneling and HTTP while building something lightweight and useful.
- Secure by Default Hidden files and directories (.git, .env, etc.) are automatically blocked from being served.
- Gzip Compression Assets are compressed when the client supports it.
- Zero Configuration Run it in any directory you want.
There are two ways to install xend.
You can download the latest pre-compiled binary for your operating system from the Releases page. This is the easiest way to get started.
If you prefer to build it yourself, you'll need Go installed.
Prerequisites
- Go 1.24 or higher
Steps
-
Clone the repository:
git clone https://github.com/mrshabel/xend.git cd xend -
Build the binary:
go build .This will create an executable named
xend(orxend.exeon Windows) in the current directory.
You can run the server by pointing it to the directory you wish to serve.
# serve the current directory on localhost:8000
./xend
# serve a specific directory on a different port
./xend -dir ./public -port 9090
# see all available options
./xend -h| Flag | Description | Default |
|---|---|---|
-host |
HTTP network host to listen on | localhost |
-port |
HTTP network port to listen on | 8000 |
-dir |
Root directory to serve files from | . |
xend is perfect for exposing a local folder to the internet securely with Cloudflare Tunnel.
-
Start the
xendserver:# Serve the 'example' folder on the default port 8000 ./xend -dir /example -
Expose it with
cloudflared:In a new terminal, run the
cloudflaredcommand to create a tunnel to your local server.cloudflared tunnel --url http://localhost:8000
This generates a random public URL that securely tunnels traffic to your local
xendinstance. You may also configure your own custom public domain to point to the instance on the Cloudflare dashboard