Ruby webrick/httpproxy and headers

I’ve been trying to get some sort of confirmation or examples on this
all day and have so far had no luck.

Using the webrick httpproxy class(?) I have been trying to get it so
that on certain sites when they are visited though the proxy I am able
to replace the cookie being sent so that the site loads the correct
details for everyone that uses the proxy.

I was able to get this sorta working using the “Net::HTTP” class, but
the problem with that is that it’s not really a proxy. I was using it as
a servlet so that when I went to my local machine in the browser it
would launch the servlet code and goto the site and display it correctly
in my browser. It would however still show the original sites URL in the
links, which I was able to replace as well, but then it kept getting
more and more complicated. And in the future I would like to have
support for more than 1 site without having a bunch of different
settings in place to get them all working correctly.

I found a similar type of ruby code at
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/142072 which
I see is able to delete and add headers but when trying to add the
cookie header it didn’t produce any other results. So that is also why
I’m not even sure if the proxy can replace the cookies.

I’m still kinda new to ruby and have been able to make it this far but
using the proxy class is a bit confusing for me. If anyone has any other
recommendations on a different proxy class or anything like that, then
that would be awesome.
Thanks. :slight_smile:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs