# Tricky socks question: changing source IP on Net::HTTP

**URL:** <https://www.ruby-forum.com/t/tricky-socks-question-changing-source-ip-on-net-http/108125>\
**Category:** Ruby\
**Created:** [June 29, 2007, 6:55am UTC](https://www.ruby-forum.com/t/tricky-socks-question-changing-source-ip-on-net-http/108125 "2007-06-29T06:55:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 29, 2007, 6:55am UTC](https://www.ruby-forum.com/t/tricky-socks-question-changing-source-ip-on-net-http/108125/1 "2007-06-29T06:55:29Z")

</div>

Howdy,

I’ve got an interface with multiple IP addresses and I’m looking to  
make HTTP requests from the non-primary IP.

How would I pull that off?

Cheers,

Eddie

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 29, 2007, 5:32pm UTC](https://www.ruby-forum.com/t/tricky-socks-question-changing-source-ip-on-net-http/108125/2 "2007-06-29T17:32:45Z")

</div>

I may well be wrong, but I don’t think you can set that programatically.  
What you could do, though, is either make that virtual interface - I’m  
assuming you’re using virtual interfaces to implement multiple IP  
address on  
an interface - the default route via the OS functions, or run a proxy on  
that  
virtual interface and set Net::HTTP to use that proxy.

_waits to be corrected as I’m not too familiar with Net::HTTP_

HTH,

Felix
