java - How to make my device's IP address accessible from anywhere? -


i working on app sends messages other phones. kind of chat messenger in way. way app supposed work user enters ip address , message , app send message specified ip address. have server , client working within same app. way, phone able connect other phone because each have independent server accessed via device's ip address. however, not able connect ip address not located on lan. i want know how make server receive messages devices not connected lan?

i read port forwarding , seems solution, security risks not encouraging. thinking using public ip address, such amazon's web server, run server on , ip address accessible anywhere world wide. problem how server know device send message to?

your "service" listening incoming messages need public addressable ip address. address in range listed below referred private , cannot reached "globally". private local area network.

192.168.0.0 - 192.168.255.255 (65,536 ip addresses)
172.16.0.0 - 172.31.255.255 (1,048,576 ip addresses)
10.0.0.0 - 10.255.255.255 (16,777,216 ip addresses)

further more "service" ip address can behind nat firewall, means "service" ip address appears public not public. nat ip gets translated ip address. typically happens @ internet service provider or telco network operator.

they way solve puzzle have public addressable server somewhere hosting company , use route messages.

each mobile client can connect server , obtain identifier, possibly tied users email address. once registerd mobile client can ask server enqueue messages particular user.

one use google cloud messaging delivery mechanism, way 1 wake mobile clients collect message server. or message can within push message.


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -