Thanks for your help Jean-Paul.<br><br>In my example I've just subclassed the protocol and factory so I could print out the properties and have a little control over things as I learn. The proxy could of course be much easily run as<br>
<br><pre class="literalblock"> from twisted.web import http<br> f = http.HTTPFactory()<br> f.protocol = Proxy</pre>I should be a bit more specific about what I'm currently confused about.<br><br><b>I'm trying to find where I can grab the request URI from the client so I can modify it from <a href="http://www.asdf.com.MYPROXYSITE.com">www.asdf.com.MYPROXYSITE.com</a> to <a href="http://www.asdf.com">www.asdf.com</a> before the proxy client makes its requests. Where can you access and modify those parameters?</b><br>
<br>Dave<br><br><br><br><div class="gmail_quote">On Mon, Jul 20, 2009 at 1:41 PM, Jean-Paul Calderone <span dir="ltr"><<a href="mailto:exarkun@divmod.com">exarkun@divmod.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Mon, 20 Jul 2009 12:01:22 -0500, dave fowler <<a href="mailto:davefowler@gmail.com">davefowler@gmail.com</a>> wrote:<br>
>Ok, I've read the entire Twisted O'Reilly book and gone through many of the<br>
>docs and tutorials but I still need a bit of direction.<br>
><br>
>I'm trying to make a simple web-based proxy. Similar to the proxy in the<br>
>Twisted book, but with a web interface. So I could go to<br>
><a href="http://asdf.com.MYPROXYSITE.com" target="_blank">http://asdf.com.MYPROXYSITE.com</a> and see the contents of <a href="http://asdf.com" target="_blank">asdf.com</a>.<br>
><br>
>I have the following code that works well as a browser proxy, but I need to<br>
>figure out how make it web based.<br>
><br>
>My thoughts are that I need to make an HTTP server and then adjust the<br>
>address in the protocol before finishing the proxy request. Am I on the<br>
>right track? Does anyone have examples of this?<br>
><br>
<br>
</div>The HTTP proxy implemented in twisted.web.proxy is probably a better<br>
starting point. Or, it's at least a good example of how to get a basic<br>
proxy together. :)<br>
<br>
I think you're on the right track, but if you don't want to have to implement<br>
this all yourself, you probably don't have to.<br>
<br>
Jean-Paul<br>
<br>
_______________________________________________<br>
Twisted-web mailing list<br>
<a href="mailto:Twisted-web@twistedmatrix.com">Twisted-web@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web</a><br>
</blockquote></div><br>