views:

448

answers:

2

Hey all,

Does anybody know how to implement an HTTP PROXY with oauth for rails? I'm using the oauth gem but am behind a proxy server.

Finding it very difficult to work this out. Very frustrating!

Thanks for any help,

John

A: 

Solution NOT tested Did you try to set the OAuth::Consumer.proxy = http://login:password@ip_address/ You can do this on RequestToken.consumer.proxy or even on AccessToken.consumer.proxy

It should from what I've seen in the ruby library.

Good luck

+1  A: 

Try adding the :proxy property when you create your consumer:

@consumer = OAuth::Consumer.new( consumer_key, consumer_secret, {
  :site               => 'http://site.com',
  :proxy              => 'http://proxy.mycompany.com:8080',
  :request_token_path => "/oauth/request_token",
  :access_token_path  => "/oauth/access_token",
  :authorize_path     => "/oauth/authorize"
  })
Stephen Petschulat