mardi 29 décembre 2015

Dynamically hosting website from behind router

I built a small app on a raspberry pi, which, among other things, hosts a simple website to allow a user to control it from a mobile device. Currently, the website is available through the pi's ip address, which is only visible on the LAN. I'd like to make this visible from the WAN.

Now, to complicate matters, it looks like I'm going to be building a couple dozen of these devices, and they will not all be on the same LAN. What I was thinking, is to have the device register itself with a program running on an external server with a common domain name (which I currently have access to). Once registered, a user could access an individual pi via a domain-name with a device key (the program on the server would map the device key to the particular device's ip)

There seems to be a lot of web-sites describing using a domain mapped directly to a particular device, but that would require a lot of domain names, and I'd rather have things more dynamic. I'm wondering if this is the right approach, and if it is, how would I go about redirecting a web page to something behind a LAN?




Aucun commentaire:

Enregistrer un commentaire