STUN server in ejabberd
Posted by Nicolas Vérité on August 17, 2009ejabberd has gained a STUN server, helping Jingle communications.
STUN stands for Simple Traversal Utilities for NAT. And NAT stands for Network Address Translation.
NAT devices, such as routers and firewalls, translate a private IP address into a public IP address. When you are not directly connected to the internet, but you are in a LAN behind a NAT, you can only know your private LAN address. Thus a Jingle contact of yours may not be able to join you.
STUN is a protocol designed to discover the mapping between your public and private address. A STUN server is located on the public internet, thus knowing the public addresses. Then if you are behind a NAT and want to initiate a Jingle session with a contact, you can discover and send your public address to this contact.
ejabberd's STUN server will help Jingle communications to happen when parties are separated by a NAT, by providing a public service for IP addresses and ports discovery.
You can get it at:
svn co http://svn.process-one.net/ejabberd/trunk/src/stun/
The documentation is here: http://svn.process-one.net/ejabberd/trunk/doc/guide.html
Example configuration:
{listen,
[
...
{{3478, udp}, ejabberd_stun, []},
{3478, ejabberd_stun, []},
{5349, ejabberd_stun, [{certfile, "/etc/ejabberd/server.pem"}]},
...
]
}.
Example DNS SRV configuration:
_stun._udp IN SRV 0 0 3478 stun.example.com.
_stun._tcp IN SRV 0 0 3478 stun.example.com.
_stuns._tcp IN SRV 0 0 5349 stun.example.com.
Categories: Misc
Share article:
Tweet this
Make delicious
Stumble upon
Comments
No comments so far, you could be the first.Add comment

Stay Informed
Subscribe to our RSS feed or follow us on Twitter to receive alerts when we post new news stories and blogs.
Subscribe to ProcessOne RSS feed
Follow ProcessOne on Twitter
Follow Mickaël on Twitter
Search our blogs
To make it easier for you to find blogs on topics that you are interested in, we have grouped them into categories depending on the different themes addressed in each blog. Categories include:
ProcessOne
Jabber / XMPP
ejabberd
Erlang
CEAN
Information Technology
Misc
Tsung
French
Mozilla
Employment opportunities
IMtrends
All categories
Become a ProcessOne partner
Find out about the benefits of joining ProcessOne’s partnership programme.
Click here
Our products and services
We offer packaged solutions comprising all of the server-side and client-side technology necessary to create valuable new instant messaging applications. In addition, we offer a range of services for delivering customised solutions.
Click here for full details