Novage / wt-tracker

High-performance WebTorrent tracker
Apache License 2.0
253 stars 88 forks source link

Add option to serve `public` folder #38

Open piranna opened 3 years ago

piranna commented 3 years ago

At https://github.com/Novage/wt-tracker/blob/400a4369fbe656e041514c7a08a94092888afc2f/lib/run-uws-tracker.ts#L238-L246 is being explicitly forbidden to serve any content that are not the WebTorrent WebSocket connections, the JSON stats endpoint, or an index.html file. In the same way that serving the index.html file is an opt-in, it would be useful to allow to check and serve a public folder before give up and return a 404, maybe being the index.html file inside it. That would allow to serve not only some Javascript and CSS files associated with the index.html file, but more important, it would allow to serve the actual HLS fragments directly from the same server, without needing to spin-up other processes.