Note that there are some explanatory texts on larger screens.

plurals
  1. PORails applicaiton behing proxy
    text
    copied!<p>I'm implementing Rails alumni application with Facebook API support. One of the requirements is to post a message from the application directly to facebook wall. Everything seems to work fine, however there is one issue which I can't fix. When I'm working at the University, I got an error "No connection could be made because the target machine actively refused it". This is because I'm behind University proxy. I've done some googling and tried some changes in code and still got the same message. </p> <p>The only way I can make this work is very hacky. If I change the method signature in http.rb class from</p> <pre> def HTTP.new(address, port = nil, p_addr = nil, p_port = nil, p_user = nil, p_pass = nil) h = Proxy(p_addr, p_port, p_user, p_pass).newobj(address, port) h.instance_eval { @newimpl = ::Net::HTTP.version_1_2? } h end </pre> <p>to</p> <pre> def HTTP.new(address, port = nil, p_addr = nil, p_port = nil, p_user = nil, p_pass = nil) h = Proxy("proxy.uni.ac.uk", 8080, p_user, p_pass).newobj(address, port) h.instance_eval { @newimpl = ::Net::HTTP.version_1_2? } h end </pre> <p>The stack trace I got, when using default http.rb is</p> <pre> c:/ruby/lib/ruby/1.8/net/http.rb:565:in `initialize' c:/ruby/lib/ruby/1.8/net/http.rb:565:in `open' c:/ruby/lib/ruby/1.8/net/http.rb:565:in `connect' c:/ruby/lib/ruby/1.8/timeout.rb:48:in `timeout' c:/ruby/lib/ruby/1.8/timeout.rb:76:in `timeout' c:/ruby/lib/ruby/1.8/net/http.rb:565:in `connect' c:/ruby/lib/ruby/1.8/net/http.rb:558:in `do_start' c:/ruby/lib/ruby/1.8/net/http.rb:547:in `start' c:/ruby/lib/ruby/1.8/net/http.rb:404:in `post_form' c:/ruby/lib/ruby/gems/1.8/gems/facebooker-1.0.54/lib/facebooker/service/net_http_service.rb:4:in `post_form' c:/ruby/lib/ruby/gems/1.8/gems/facebooker-1.0.54/lib/facebooker/service.rb:78:in `post_form' c:/ruby/lib/ruby/gems/1.8/gems/facebooker-1.0.54/lib/facebooker/service.rb:66:in `post' c:/ruby/lib/ruby/gems/1.8/gems/facebooker-1.0.54/lib/facebooker/session.rb:610:in `post_without_logging' c:/ruby/lib/ruby/gems/1.8/gems/facebooker-1.0.54/lib/facebooker/session.rb:621:in `post' c:/ruby/lib/ruby/gems/1.8/gems/facebooker-1.0.54/lib/facebooker/logging.rb:20:in `log_fb_api' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/benchmark.rb:10:in `realtime' c:/ruby/lib/ruby/gems/1.8/gems/facebooker-1.0.54/lib/facebooker/logging.rb:20:in `log_fb_api' c:/ruby/lib/ruby/gems/1.8/gems/facebooker-1.0.54/lib/facebooker/session.rb:620:in `post' </pre> <p>Can anyone please help, how I can make this work. Any help would be appreciated.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload