networking - Port is closed,Android chat Application -


during last couple of months i've been creating own chat application. used xmpp protocol, , implementation used smack library creating android clients , openfire server.

i tested app in local network , in network port 5222 (the port openfire uses connection between client , server) open.

i moved openfire server host , struggled connect app server, , found port 5222 closed isp , mobile network provider well.
here 2 questions:

  1. is there solution somehow bypass restriction?
  2. in openfire can change port, don't know if there standard port kind of application.

    i tested isp's ip address this , common ports closed , port 80 well. can use browser , see website. can use ftp (port 21) why can use close ports ??

in general case, instead of:

 =========               =========  = app 1 =  <----------> = app 2 =  =========               ========= 

you do:

 =========               =========  = app 1 =  ----------> = server =  =========               =========                             ^  =========                  |  = app 2 =  -----------------  =========                

that is, firewalls typically disallow inbound connections, not outbound connections. so, around this, set server using hosting service accepts inbound requests, , other apps/nodes (which may behind firewall) initiate requests server (rather listening on local port , waiting contacted server). server acts intermediary forward requests between 2 (so apps can receive , not send data).

for receiving frequent messages, can contact intermediary server @ regular interval, , ask if there new messages (if so, download them, , notify user; if not disconnect , go sleep check-in again later). however, shouldn't reinvent wheel here; google cloud messaging (gcm) this. so, basically, intermediary server should receive / store xmpp messages on behalf of android app, should forward information android app using gcm (so android app takes advantage of gcm's regular check-ins without adding own battery-eating check-ins).

now, in terms of intermediary server, can check see if there other ports isp allows through (the port use, aside need not conflict other apps on server, matters in terms of discoverability; e.g., xmpp application intended interoperate other xmpp clients? if so, clients allow user specify custom port number, or assume specific port?). however, it's possible isp blocks ports, in case, i'm afraid there isn't can except use hosting service expecting inbound traffic , has unblocked ports. if hosting on own consumer isp connection, may find not viable option isp. suggest alternative hosting options; personally, i'm biased in favor google cloud platform, many options abound.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -