Update README.md

This commit is contained in:
Anthony Wang 2021-07-21 15:34:06 +00:00 committed by GitHub
parent f43ee5de38
commit 53480171eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,2 +1,29 @@
# Easy-LAN-Share
Finally an easy way to share text and files on your LAN!
# Easy LAN Share
Finally an easy way to share text and files on your LAN! It only takes 15 seconds! No dependencies except for a shell and Python!
## A scenario
Let's say you have a long link or file that you want to share with a friend on your LAN. You could just email or message your friend the content, but it seems like a waste to route it through someone else's email or chat server. FTP? F\*ck that protocol. SCP? Sh\*t copy protocol. There has to be an easier way, right?
## Getting started
First, get your private IP address:
```sh
ip route get 1.1.1.1 | grep -oP 'src \K[^ ]+' # ip -c address also works
```
If you want to share text, create a file and paste in the text:
```sh
xdg-open share.txt # Open file in your default editor
```
Otherwise, navigate to the directory with the file you would like to share. Now, unleash Python's built-in HTTP server!
```sh
python -m http.server
```
Now scream your private IP address to your friend and tell them to go to http://*IPADDRESS*:8080 in their web browser. All they need to do is download the file. Done!
## Scripting
Well, that was easy enough that you could probably easily write a script to do it. Lucky for you, check out [share.sh](share.sh) for a prewritten script to automate this process.
## License
Read the [LICENSE](LICENSE)! It's fun!