A single-fire, first-come; first-served HTTP server.
Easily transfer files to and from your terminal and any browser on your local network.
💡 How it works 💡
The first client to connect is allowed to attempt the file transfer.
All other clients attempting to connect during the transfer will be queued and allowed to attempt the transfer if the current client fails.
Once the transfer is succesful, all queued clients will receive 410 GONE status and oneshot will exit.
✨ Features ✨
- 📄⏬ Trigger download prompt in connecting browsers (can be disabled)
- 📄⏫ Offers a minimalistic and JS-free site prompting users to select a file or type in text to upload
- ⚙ Serve from stdout and upload to stdin; oneshot is designed to be pipelined
- 🗣 Set custom HTTP headers
- 🔐 Encrypted file transfers via HTTPS
- 🔏 Self-signed SSL/TLS certificates
- 🗝 Username and password authentication
- 🎲 Randomly generated authentication credentials
- 📁⏬ Send entire folders; oneshot will take care of compressing them into .zip or .tar.gz files
- 🔎 Allow others to easily connect to your computer; oneshot can register itself as an mDNS (Avahi/Bonjour) service
- ⚡ Run commands and programs when a client connects and send them the output; oneshot offers a forgiving CGI (RFC 3875) environment with defaultable headers.
Use your non-CGI scripts to respond to HTTP traffic.
- ✨ and more!
💾 Download & Install 💾
Download binary (easiest method)
curl -L https://github.com/raphaelreyna/oneshot/raw/master/install.sh | sudo bash
brew tap raphaelreyna/homebrew-repo && brew install oneshot
go get -u -v github.com/raphaelreyna/oneshot
Compiling from source
git clone github.com/raphaelreyna/oneshot && cd oneshot && sudo make install
Head over to the releases page
and download the windows .zip file.
Windows users might be interested in checkout Goneshot
If for some reason, you would rather not
use a command line,
(beta) wraps oneshot with a GUI, which might be easier to use.
A macOS version will probably be made at some point.
❓ Frequently Asked Questions ❓
What is this?
Oneshot lets others on your local network use their browsers on their computers,
phones or any other device to send or receive files from your computer.
Why would I use this over netcat/ssh/rsync/[insert other unixy tool here]?
Most people either don't have access to these tools or don't care/know how to use them,
but they do have a browser and they know how to use it.
Wouldn't it be nice to share with them?
Why would I use this over [insert some other HTTP server here]?
There are several ways in which oneshot differs from other HTTP servers.
Mainly, oneshot is meant for 'one-and-done' type tasks.
Once the data to be transferred has been sucessfully transferred, oneshot will exit.
This behavior, combined with its ability to serve from stdin and send uploaded data to stdout makes it ideal for pipelining and using in scripts.