Create a file sharing server with Ngrok

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

N?o foi fornecido texto alternativo para esta imagem

Hands-on

1. Open your terminal

N?o foi fornecido texto alternativo para esta imagem

2. Check if the Ngrok is installed on your computer

ngrok --version
        
N?o foi fornecido texto alternativo para esta imagem

3. Authenticate your Ngrok agent with the auth token copied earlier


ngrok config add-authtoken YOUR_COPIED_TOKEN_HERE
        
N?o foi fornecido texto alternativo para esta imagem

4. Check if Ngrok has been configured


ngrok config check
        
N?o foi fornecido texto alternativo para esta imagem

5. Create and access shared folder and add the files in it


mkdir shared && cd shared
        
N?o foi fornecido texto alternativo para esta imagem

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"
        
N?o foi fornecido texto alternativo para esta imagem
N?o foi fornecido texto alternativo para esta imagem

7. Open your browser and check if the Ngrok Inspect Service is up

N?o foi fornecido texto alternativo para esta imagem

8. Click on the displayed URL and access your files on the internet

  • Use this URL on other devices like your mobile

N?o foi fornecido texto alternativo para esta imagem
N?o foi fornecido texto alternativo para esta imagem

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.

Volmir Moderoso Santos MBA

Infrastructure Specialist and Analytics at MUFG

2 年

Bem bacana

要查看或添加评论,请登录

Eliel S.的更多文章

社区洞察

其他会员也浏览了