Home > Net >  Its possible to make a local webserver be worldwide vía Android Studio and a API of a third party?
Its possible to make a local webserver be worldwide vía Android Studio and a API of a third party?

Time:09-15

i need to broadcast a local Webserver to internet, i know of services like ngrok that can do that, but the big problem of that service is that needs to be executed in an external application. I was wondering if i can do something similar internally in Android Studio (With an API of a third party or something). To give you a context i made a webserver in Arduino, that have a local ip and i know that its possible to broadcast the information to internet with a "tunel" (that can be Ngrok), the thing is that i want to be able to configure EVERYTHING vía application, so im going to give via app the SSID and password of the WIFI using a bluetooth module, then the arduino is gonna create the web server, but this server is local and i need the server be global, thats why i thought that maybe there exists something similar to ngrok but for being used and configured by applicattions internally. So again, i dont want to use PC, or other application, just the APP or maybe do it in arduino itself. Thanks you so much in advance, feel free to share your thoughts.

CodePudding user response:

When creating a server you can decide where you want to expose it. I recommend to take a look at What is the difference between 0.0.0.0, 127.0.0.1 and localhost?

Ngrok allows us to redirect a domain to a local element. Ngrox will only expose your webserver to internet if your webserver expose on localhost, if it expose on 0.0.0.0 and is properly configured (not firewall issue with the ports) you will be able to access it using your machine ip.

You can see this application Simple HTTP Server which seems to do what you are asking.

CodePudding user response:

The only thing you have to do is going to the settings of your router and forward the used port to the ip of the local machine where your webserver is running on.

Thats all.

  • Related