brandoncheah
Posts: 31
Joined: Thu Sep 27, 2018 9:52 am

Expose FLASK web server API to the internet

Mon Jul 29, 2019 8:54 am

I've created RESTful API using Flask and I can access the API in local network.
In order for any network to access this API, I understand I need to expose this Flask web server to the internet.

I would not like to configure port forwarding on my router, so this method is put aside.

I tried using NGROK to expose web server in the RPi, it works nicely.
As I know I need to create a free account for a process. But if I were to go into production, I will have hundreds to millions of Raspberry Pi and I will have to create a million NGROK account.

Is it possible to host/setup a NGROK server and manage it ourselves?

Or are there any methods to expose local web server to the internet?

Andyroo

Re: Expose FLASK web server API to the internet

Mon Jul 29, 2019 11:06 am

NGROK is a commercial product - thats how they pay for the development costs. (I'm sure they also protect their IP).

I would also ask if you honestly expect a Pi to service that many users and if you would do better to approach a venture capitalist for seed funding if the 'project' is going to be that big?

Asking for free advice for commercial products is not really the aim of this forum.

Maybe ask the mods to move this to the 'wanted' section for a contractor that can help set this up and handle NDAs with you?

blimpyway
Posts: 591
Joined: Mon Mar 19, 2018 1:18 pm

Re: Expose FLASK web server API to the internet

Mon Jul 29, 2019 8:12 pm

In a comercial setup you can set up your own virtual server on Google/Amazon/whatever and use VPN or ssh tunnels to expose an arbitrary number of Pi-s with their own flasks hidden behind their own routers.

This a middleware setup and there are many options to consider when you will actually need to expose such a large service as you hope to. It should be transparent to your flask application.

h_smith_usa
Posts: 3
Joined: Thu Jan 16, 2020 1:52 pm

Re: Expose FLASK web server API to the internet

Thu Jan 16, 2020 4:08 pm

I found this page you might find interesting.

Tunnelling services for exposing localhost to the web

https://www.chenhuijing.com/blog/tunnel ... o-the-web/

I am also interested in this topic and it seems a practical area of discussion where creators are considering incorporating the Pi boards in to products.

Thanks.

Return to “Networking and servers”