Which port(s) does XMPP use?

前端 未结 4 1516
春和景丽
春和景丽 2021-01-30 12:52

I´ve searched and didnt find which ports does XMPP uses. I need to implement XMPP server and client and use XML transfer, file transfer and streaming. Do they use different port

相关标签:
4条回答
  • 2021-01-30 13:28

    The official ports (TCP:5222 and TCP:5269) are listed in RFC 6120. Contrary to the claims of a previous answer, XEP-0174 does not specify a port. Thus TCP:5298 might be customary for Link-Local XMPP, but is not official.

    You can use other ports than the reserved ones, though: You can make your DNS SRV record point to any machine and port you like.

    File transfers (XEP-0234) are these days handled using Jingle (XEP-0166). The same goes for RTP sessions (XEP-0167). They do not specify ports, though, since Jingle negotiates the creation of the data stream between the XMPP clients, but the actual data is then transferred by other means (e.g. RTP) through that stream (i.e. not usually through the XMPP server, even though in-band transfers are possible). Beware that Jingle is comprised of several XEPs, so make sure to have a look at the whole list of XMPP extensions.

    0 讨论(0)
  • 2021-01-30 13:29

    According to Extensible Messaging and Presence Protocol (Wikipedia), the standard TCP port for the server is 5222.

    The client would presumably use the same ports as the messaging protocol, but can also use http (port 80) and https (port 443) for message delivery. These have the advantage of working for users behind firewalls, so your network admin should not need to get involved.

    0 讨论(0)
  • 2021-01-30 13:32

    The ports required will be different for your XMPP Server and any XMPP Clients. Most "modern" XMPP Servers follow the defined IANA Ports for Server-to-Server 5269 and for Client-to-Server 5222. Any additional ports depends on what features you enable on the Server, i.e. if you offer BOSH then you may need to open port 80.

    File Transfer is highly dependent on both the Clients you use and the Server as to what port it will use, but most of them also negotiate the connect via your existing XMPP Client-to-Server link so the required port opening will be client side (or proxied via port 80.)

    0 讨论(0)
  • 2021-01-30 13:35

    According to Wikipedia:

    5222 TCP     XMPP client connection (RFC 6120)        Official  
    5223 TCP     XMPP client connection over SSL          Unofficial
    5269 TCP     XMPP server connection (RFC 6120)        Official
    5298 TCP UDP XMPP JEP-0174: Link-Local Messaging /    Official
                 XEP-0174: Serverless Messaging
    8010 TCP     XMPP File transfers                      Unofficial    
    

    The port numbers are defined in RFC 6120 § 14.7.

    0 讨论(0)
提交回复
热议问题