Xmpp4r and ejabberd

Im using xmpp4r and ejabberd and my server runs on EC2 on an elastic IP.

My problem is I am unable to connect to the server and my requests

On certain occasions the requests go through but the registrations dont
reflect on the admin console. Most of the time i get a request timeout

My jabber server runs on a subdomain jabber.example.com.


client= Jabber::Client.new(Jabber::JID.new(“[email protected]”))
… Successful connection …
Errno::ETIMEDOUT: Connection timed out - connect(2)
initialize' from /usr/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:66:in new’
connect' from /usr/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:70:in connect’
from (irb):4

Im completely lost now I have tried reinstalling ejabberd but i keep
having this issue. Am i missing something basic here?

Thanks in advance

Its actually an EC2 security groups issue. You need to ensure if the
instance security groups has the port 5222 open. If your working with
Server-2-Server then you should have 5269 open too.

The way to get that done on elastic fox is click on the security groups
click on the group permissions, grant permission button (green tick
button) and add the port. For host add to allow all.

And thats it. Hope this is useful to someone. I can’t believe I missed