Grant Connections only from a website | Telit Cinterion IoT Developer Community
January 2, 2017 - 4:22pm, 1345 views
I have an app in which I receive http requests built on my BGS5T. Currently, I'm managing the host to connect into the webserver by IP. My website has a static IP which I can use to connect or not into my app. However, this is not the best behaviour. In long term, my website might change its provider, changing its IP, what would make me change the configuration. What I ask is this: is there anyway to allow or block connections via website name? Something like
String website = "www.dummy.com"
if socket.websitename == www.dummy.com
} else socket.close();
Thanks in advance
Is this the same scenario as here: https://iot-developer.thalesgroup.com/threads/get-url-socket ?
If you would like to filter the clients connecting to your server on the module by the domain name than you'd have to do some kind of reverse DNS lookup as in the above thread. When the client connects to your server you can only read it's IP address on the TCP layer and not the domain. So to get the domain you need to ask the DNS server.