twitter status behind http proxy

33 views
Skip to first unread message

krzysztof cierpisz

unread,
Sep 6, 2010, 7:07:29 PM9/6/10
to twitter4r-users
in the older versions of twitter4r it was enough to:

Twitter::Client.configure do |conf|
conf.host = 'twitter.com'
conf.proxy_host = 'myhttpproxy'
conf.proxy_port = myhttpport
conf.user_agent = 'UserAgent'
conf.application_name = 'AppName'
conf.application_version = 'v0.9.7'
conf.application_url = 'http://myapp.url'
end

twitter = Twitter::Client.new(:login => 'username', :password =>
'pass')

twitter.status(:post,"test_tweet")

Now with Oath this works when I am not behind proxy:

Twitter::Client.configure do |conf|
conf.host = 'twitter.com'
# conf.proxy_host = 'myhttpproxy'
# conf.proxy_port = myhttpport
conf.user_agent = 'UserAgent'
conf.application_name = 'AppName'
conf.application_version = 'v0.9.7'
conf.application_url = 'http://myapp.url'
end

CONSUMER_KEY = 'cons_key'
CONSUMER_SECRET = 'cons_secret'

ACCESS_KEY = 'access_key'
ACCESS_SECRET = 'access_secret'

twitter = Twitter::Client.new(
:oauth_consumer => { 'key' => CONSUMER_KEY,
'secret' => CONSUMER_SECRET },
:oauth_access => { 'key' => ACCESS_KEY,
'secret' => ACCESS_SECRET },
:login => "username")
twitter.status(:post,"test_tweet")

But I am still unsuccessful in running that behind http proxy.
uncommenting proxy_host and proxy_port is not enough.
The connection is not established when executing send on access_token:
from /home/chris/.rvm/gems/ree-1.8.7-2010.02/gems/oauth-0.4.3/lib/
oauth/tokens/access_token.rb:44:in `post'
from /home/chris/.rvm/gems/ree-1.8.7-2010.02/gems/twitter4r-0.5.0/lib/
twitter/client/base.rb:24:in `send'
from /home/chris/.rvm/gems/ree-1.8.7-2010.02/gems/twitter4r-0.5.0/lib/
twitter/client/base.rb:24:in `rest_oauth_connect'
from /home/chris/.rvm/gems/ree-1.8.7-2010.02/gems/twitter4r-0.5.0/lib/
twitter/client/status.rb:47:in `status'
from whatismyip2.rb:73

Is there a plan to support http proxy? or maybe there is already but I
just cannot use that properly?

thanks,
chris

Susan Potter

unread,
Sep 6, 2010, 8:36:41 PM9/6/10
to twitter...@googlegroups.com
Chris,

I am so glad you brought this to my attention. This is a new bug in
v0.5.0 due to a massive oversight on my part. Based on a blog post
about using the Ruby OAuth gem behind a proxy I can probably add this
into v0.5.1 since I wasn't able to release on Friday afternoon/evening
due to a production issue at work.

I have implemented two bugfixes out of the original three I had
planned to fix in 0.5.1 and now (assuming the proxy fix is as simple
as the blog post article I found) I will also roll in the OAuth proxy
support too.

New ETA Tuesday evening CDT (GMT-5h). This time it really should
happen since I am not going to be on call for production issues this
week.

Best,
Susan

> --
> You received this message because you are subscribed to the Google Groups "twitter4r-users" group.
> To post to this group, send email to twitter...@googlegroups.com.
> To unsubscribe from this group, send email to twitter4r-use...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/twitter4r-users?hl=en.
>
>

--
mailto:m...@susanpotter.net
twitter:@SusanPotter
github:mbbx6spp
blog:http://geek.susanpotter.net
linkedin:http://www.linkedin.com/in/susanpotter

krzysztof cierpisz

unread,
Sep 7, 2010, 3:28:39 AM9/7/10
to twitter4r-users
Thanks a lot Susan for your speedy update.

0.5.1 fixed the proxy issue.

thanks,
chris
> > For more options, visit this group athttp://groups.google.com/group/twitter4r-users?hl=en.
Reply all
Reply to author
Forward
0 new messages