Of course it depends on you definition of &quot;safe&quot; and &quot;secure&quot;, but there&#39;s a few examples around the net.  Here&#39;s a few:<br><br><a href="http://wiki.python.org/moin/Twisted-Examples">http://wiki.python.org/moin/Twisted-Examples</a><br>
<a href="http://www.linuxjournal.com/article/7871">http://www.linuxjournal.com/article/7871</a><br><a href="http://proxies.xhaus.com/">http://proxies.xhaus.com/</a><br><br>If you want to add proxy authentication, it shouldn&#39;t be too difficult...check out RFC 2068.<br>
<br><a href="http://www.ietf.org/rfc/rfc2068.txt">http://www.ietf.org/rfc/rfc2068.txt</a> (esp sections 10.4.8, 11, and 14.33-34)<br><br>It should be similar to implementing basic HTTP auth, except you want to use the <br>
Proxy-Authenticate and Proxy-Authorization headers instead of the regular ones.<br><br>I&#39;m guessing the flow would go something like:<br>- client requests a proxied resource ( without a Proxy-Authorization header )<br>
- server sends back a 407 with a Proxy-Authenticate header<br>- client prompts user for credentials<br>- client provides request again with Proxy-Authorization header<br>- server proxies the resource<br><br>of course I&#39;m no expert on web proxies so don&#39;t take my word for it...<br>
<br>I think you should be able to do the above by overriding some of the proxy classes in twisted.web.proxy<br><br>Good Luck!<br><br>Kevin Horn<br><br><br><div class="gmail_quote">On Thu, Jun 18, 2009 at 2:44 AM, Andreas Trawoeger <span dir="ltr">&lt;<a href="mailto:atrawog@gmail.com">atrawog@gmail.com</a>&gt;</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;">Hi!<br><br>Could I kindly ask all the Twisted Gurus to take a look Austin Heaps Best Proxy Practices<br>
for Iran <a href="http://blog.austinheap.com/" target="_blank">http://blog.austinheap.com/</a><br><br>The current setup (Squid &amp; iptables) everybody uses is extremely complicated to setup and it should be trivial to implement the requirements in Twisted. Turn it into an egg and allow everybody to simple type easy_install iranproxy.<br>

<br>I know a little bit of Twisted, because I&#39;m an avid Zenoss user and in different circumstanced I would write the proxy on my own. But in this case a safe implementation is a real must and I&#39;m really worried to make some stupid beginner mistakes.<br>

<br>So some (example) code and links to websites I should read would be greatly appreciated.<br><br><br>Thanks to everybody!<br><br>cu andreas<br>
<br>_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
<br></blockquote></div><br>