Issue
At start I need to mention that I'm a complete newbie if we talk about networking, so don't judge me ;)
Problem:
I've got a Flask application running on my raspberry pi. I can access it via web browser using raspberry_ip:5000
. I need to access this app outside of my local network.
I used to have port forwarding on my router so whenever I typed in browser my_public_ip:5000
I could use my app running in local network. However as many people say, port forwarding isn't the best and most secure method.
And here is my question: Can I access app on my raspberry using VPN (Private network where is only raspberry, and there is not risk of some kind of attack), becasue I guess it would be much more secure than port forwarding.
Maybe there is some other method to access this flask app outside of my network, without risking an unathorized access to local network.
sorry for my poor english
Solution
As long as the following are set, this solution sounds fine to me.
- Your Flask application is secured by user authentication.
- The Web communication is secured by an SSL certificate(using server HTTPS).
In order to be more secure, I would put a Web server in front of Flask, such as Nginx, therefore you are exposing the Nginx process to the Internet rather than Flask.
Answered By - alex