How to set up proxy for rails app?

Hello everyone,

I’m trying to create simple rails app using NetBeans
(nbextras.org) from scratch as
described here:
http://weblogs.java.net/blog/bleonard/archive/2007/03/building_a_ruby.html

But there’s a problem: since I’m behind proxy, and I’m trying to access
some resource outside (see class Flicker in enviroment.rb), app doesn’t
work; when you type some tag, and hit Find, it ends with error

SocketError in FlickrController#search

getaddrinfo: no address associated with hostname.

Is there a way how to deal with it? I.e. pass somehow my proxy settings
to WEBrick? Or the problem has to be solved on the app side?? Thanks in
advance.

You will probably need to look at the source (or the docs for the
Flickr api). I know the api uses Net::Http for communication which
does allow for using proxies. Hopefully the flickr api gives you a
way to set the proxy server and port.

If not you may have to modify the flickr module to do this where you
see Net::HTTP.start:

proxy_addr = 'your.proxy.host'
 proxy_port = 8080
 Net::HTTP::Proxy(proxy_addr, proxy_port).start('server.com') {|

http|
}

scott.

On Apr 18, 2007, at 8:03 AM, Tomas Musil wrote:

access
to WEBrick? Or the problem has to be solved on the app side??
Thanks in
advance.


Posted via http://www.ruby-forum.com/.

Scott F. Walter - http://scottwalter.com

"Opportunity is missed by most people because it is dressed in
overalls and looks like work" - Thomas Edison