Ruby 和 Rails - oauth 和 http 代理 [英] Ruby and Rails - oauth and http proxy

查看:64
本文介绍了Ruby 和 Rails - oauth 和 http 代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何使用 oauth for rails 实现 HTTP 代理吗?我正在使用 oauth gem,但在代理服务器后面.

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!

感谢您的帮助,

约翰

推荐答案

尝试在创建使用者时添加 :proxy 属性:

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"
  })

这篇关于Ruby 和 Rails - oauth 和 http 代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆