Skip to content

Instantly share code, notes, and snippets.

@kmmndr
Last active March 6, 2024 09:49
Show Gist options
  • Save kmmndr/d461cb396a1dfccd9f33e9e8422f5ec5 to your computer and use it in GitHub Desktop.
Save kmmndr/d461cb396a1dfccd9f33e9e8422f5ec5 to your computer and use it in GitHub Desktop.
Serve file using bore
#!/bin/bash
set -u
file=$1
port=9999
bore local ${port} --to bore.pub &
bore_pid=$!
{ echo -ne "HTTP/1.0 200 OK\r\nContent-Length: $(wc -c <${file})\r\n\r\n"; cat ${file}; read; } | nc -l -p ${port}
kill $bore_pid
@kmmndr
Copy link
Author

kmmndr commented Mar 6, 2024

macOS requirements

brew install bore-cli netcat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment