# How to set up proxy for rails app?

**URL:** <https://www.ruby-forum.com/t/how-to-set-up-proxy-for-rails-app/92343>\
**Category:** Rails\
**Created:** [April 18, 2007, 3:03pm UTC](https://www.ruby-forum.com/t/how-to-set-up-proxy-for-rails-app/92343 "2007-04-18T15:03:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomas\_Musil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/9dc877/32.png) [@Tomas\_Musil](https://www.ruby-forum.com/u/Tomas_Musil)\
**Post date:** [April 18, 2007, 3:03pm UTC](https://www.ruby-forum.com/t/how-to-set-up-proxy-for-rails-app/92343/1 "2007-04-18T15:03:02Z")

</div>

Hello everyone,

I’m trying to create simple rails app using NetBeans  
([nbextras.org](http://deadlock.nbextras.org/hudson/job/ruby/1013/)) from scratch as  
described here:  
[http://weblogs.java.net/blog/bleonard/archive/2007/03/building\_a\_ruby.html](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.

---

<div class="post-metadata">

**Author:** ![Tomas\_Musil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/9dc877/32.png) [@Tomas\_Musil](https://www.ruby-forum.com/u/Tomas_Musil)\
**Post date:** [April 18, 2007, 3:27pm UTC](https://www.ruby-forum.com/t/how-to-set-up-proxy-for-rails-app/92343/2 "2007-04-18T15:27:39Z")

</div>

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/](http://www.ruby-forum.com/).
> 
> >

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

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