Listingway is a caddy file server browse template that provides a light and clean user interface. It also includes a parallel downloader that can accelerate download speeds under certain network conditions.
Try a live demo now! (Note: This statically generated demo may not provide the full experience of running under Caddy.)
- Dark mode / Light mode
- Parallel downloader
- Fully self-contained, no CDN resources
Download the bundle from releases and upload it to your server. Then add the configuration below:
file_server {
root /usr/share/nginx/html
browse /usr/share/nginx/listingway/index.html
}
handle /_listingway/assets/* {
uri strip_prefix /_listingway/assets
root /usr/share/nginx/listingway/assets
file_server
}Note that you should not change the _listingway/assets part in the handle and uri directives, unless you build your own bundle.
Create a config.json under listingway folder with the following content:
{
"prefixes": ["http://localhost:8081", "http://127.0.0.1:8081"],
"chunkSize": 1048576,
"concurrent": 4
}You can also use the respond directive in your Caddyfile:
respond /_listingway/config.json <<CONFIG
{ "chunkSize": 1048576, "concurrent": 4 }
CONFIG 200All fields can be omitted if you don't need it.
File will be download as chunks split by this size in bytes.
Concurrent requests for download a single file.
If given, file will be downloaded from this list of prefix. The origin of the listing page will be replaced by the prefix given. Remember to include the prefix you used to serve the listing page if you want.
If multiple prefixes are given, workers will select one of them round-robin.
This is useful to bypass the h2 multiplexing since browser will not multiplexing connections to different top-level domains.
CORS must be enabled while using this option. Sample config below:
header {
Access-Control-Allow-Origin "*"
Access-Control-Allow-Methods "GET, OPTIONS"
Access-Control-Allow-Headers "Range"
Access-Control-Expose-Headers "Content-Range"
}You will only see the "Accelerated Download" button in supported browsers and under a secure context.
This means HTTP origins are not supported (use HTTPS!), except when accessing from localhost.
Please note that Safari is currently not supported due to the lack of the createWritable API, although it's possible to use the sync handle API, but I don't have any time on it.
This is common if you are using HTTP/2 on your web server.
Browsers like Chrome use multiplexing with this protocol, which results in no performance improvement.
Consider disabling HTTP/2 on your download server or setup multiple prefixes with different top-level domains.