Which port(s) does XMPP use?

XmppPorts

Xmpp Problem Overview


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 ports?? Is there a way I can make them use all the same, so I dont need to bother the network admin? Thanks

Xmpp Solutions


Solution 1 - Xmpp

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.

Solution 2 - Xmpp

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.

Solution 3 - Xmpp

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.)

Solution 4 - Xmpp

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionfredcrsView Question on Stackoverflow
Solution 1 - XmppMark ByersView Answer on Stackoverflow
Solution 2 - XmppJustin EthierView Answer on Stackoverflow
Solution 3 - XmppbearView Answer on Stackoverflow
Solution 4 - Xmppuser7177944View Answer on Stackoverflow