Or can you? Visit https://youcantdownloadthisimage.com/ to give it a go!
If you'd just like to test the code that keeps the connection open, run the following
# Build and start serving lisa.jpg on http://localhost:3000/
make
./serve
Full setup
The following assumes that you have caddy installed with systemd.
cd /opt # Navigate to /opt
git clone https://github.com/radiantly/you-cant-download-this-image # Clone repository
chown -R :caddy you-cant-download-this-image/ # Set dir group to caddy
cd you-cant-download-this-image && make # Build
Start and enable the systemd unit file to keep it running:
ln -s /opt/you-cant-download-this-image/lisa.service /etc/systemd/system/lisa.service
systemctl daemon-reload # Reload service files on disk
systemctl start lisa # Start
systemctl enable lisa # Autostart on boot
Configure caddy:
mv /etc/caddy/Caddyfile /etc/caddy/Caddyfile.bak # backup existing Caddyfile
ln -s /opt/you-cant-download-this-image/Caddyfile /etc/caddy/Caddyfile
systemctl restart caddy
MIT