title: How to create a simple and secure Socks5 proxy in python?
body: <p>Few days back I was wanting to build a proxy that could allow me to securely and anonymously connect to websites and servers. At first it seemed like a pretty easy idea, I would create an HTTP proxy that uses SSL between the client and the proxy, It would then create a SSL connection with what ever website/server the client requested and then forward that information to and from the client and server. I spent about a day researching and writing code that would do just that. But I then realized that someone could compromise the proxy and use the session key that the proxy had to decrypt and read the data being sent to and from the server.</p>
  
  <p>After a little more research it seem that a socks proxy is what I needed. However there is not much documentation on a python version of a socks proxy(Mostly just how to connect to one). I was able to find <a href="https://github.com/Anorov/PySocks" rel="nofollow">The PySocks Module</a> and read the Socks.py file. It looks great for creating a client but I don't see how I could use it to make a proxy.</p>
  
  <p>I was wondering if anyone had a simple example of a socks5 proxy or if someone could point me to some material that could help me begin learning and building one?</p>