Home:ALL Converter>Using Google App Engine to Initiate Messages to a Device Behind Firewall

Using Google App Engine to Initiate Messages to a Device Behind Firewall

Ask Time:2013-07-02T23:43:55         Author:danwiding

Json Formatter

I'd like to use Google App Engine to initiate http traffic to devices that will be behind firewalls/routers/NAT. These devices will be receiving commands from GAE. I could have the devices poll GAE looking for new messages, but this uses a lot of traffic. Alternately, I could try and hold open a connection permanently, but that is super expensive and bad.

The devices won't have static IP addresses. However, they will be communicating periodically with Google App Engine and the device can then listen to the port they just opened for any incoming communications. If I understand TCP Hole Punching since the devices already sent traffic to GAE they will have a port assigned that translates to the port the device is listening to and Correspondingly GAE have a hole available in the firewall.

However, in order for GAE to send traffic to the device it needs to know the device's assigned port on its public IP. Here in lies the problem, as GAE doesn't make available the source/remote port for incoming traffic. Without knowing the port the device just used, I can't send the device anything other than http response messages. I can't actually initiate http/tcp messages to that device.

So, does anyone know of a way of getting the incoming source/remote port for GAE or know of an alternate way of initiating traffic to devices behind firewalls?

TL;DR: How on earth do you get the remote port for http messages sent to apps on GAE?

Author:danwiding,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/17429928/using-google-app-engine-to-initiate-messages-to-a-device-behind-firewall
koma :

Since the secure data connector is deprecated, your best option is to deploy a service that will proxy the incoming requests. You have a number of options like configuring your firewall and setup port forwarding or apache reverse proxy.\n\nIf your internal addresses change, then that is also the place to deal with this. For instance, you could let the DHCP server trigger a configuration change in your apache reverse proxy.",
2013-07-02T19:50:15
yy