navgeet
navgeet

Reputation: 1007

How to use Ruby's xmpp library behind a HTTP proxy

I want to use to the xmpp4r gem to send notifications to gtalk from my Rails app. However I am behind a HTTP proxy and hence cannot use regular jabber. Also, xmpp4r supports HTTPBind but it seems gtalk does not. So is there a way to use HTTPBind with gtalk?

Upvotes: 1

Views: 293

Answers (1)

murraybo
murraybo

Reputation: 973

Use proxifier http://rubygems.org/gems/proxifier.

If your proxy is configured on the environment already (ex. by setting the environment variable http_proxy) you can simply add the following two lines to your code.

require "proxifier"
require "proxifier/env"

This enhances the used TCPSocket to support connection via proxy.

Upvotes: 1

Related Questions