Create a file sharing server with Ngrok
About
Ngrok is a CLI (Command Line Interface) tool that allows you to create a secure tunnel, behind NATs and Firewalls, that expose local services to the Internet, all this easily and securely.
Ngrok is cross-platform, so they can be installed on Linux, MacOS, or Windows.
Context
You can share folders on your computer with other people or devices using third party software, online sharing drive (like google drive), features of your operating system and many others.
The option I want to show you is a very simple way to share a folder from your computer. This is not the safest way to do this, so enjoy in moderation. OK?
Now let's create our file sharing server.
Prepare the environment
Hands-on
1. Open your terminal
2. Check if the Ngrok is installed on your computer
ngrok --version
3. Authenticate your Ngrok agent with the auth token copied earlier
ngrok config add-authtoken YOUR_COPIED_TOKEN_HERE
4. Check if Ngrok has been configured
ngrok config check
5. Create and access shared folder and add the files in it
mkdir shared && cd shared
6. Share the created shared folder on your computer using Ngrok
On Windows
ngrok http "file:///C:\Users\elielsousa\shared"
On Linux and MacOS
ngrok http "file:///Users/elielsousa/shared"
7. Open your browser and check if the Ngrok Inspect Service is up
8. Click on the displayed URL and access your files on the internet
Conclusion
Using Ngrok it was possible to share your files and folders quickly and simply. Try using other Ngrok features like adding basic authentication to your URL. To the next.
Infrastructure Specialist and Analytics at MUFG
2 年Bem bacana