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

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

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

Snippet

client= Jabber::Client.new(Jabber::JID.new(“[email protected]”))
… Successful connection …
client.connect
Errno::ETIMEDOUT: Connection timed out - connect(2)
from
/usr/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:66:in
initialize' from /usr/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:66:innew’
from
/usr/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:66:in
connect' from /usr/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:70:inconnect’
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 0.0.0.0/0 to allow all.

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs