the existent proxy types are:
- http proxy: works only with the http protocol
- http connect proxy: like the above one but covers also any other tcp protocol (imagine tcp data encapsulated in a http protocol), that's why without the "connect" method enabled is not possible to use the ssl layer of the https websites
- socks 4/5: any tcp protocol
- socks 5+udp: any tcp and udp protocol
personally I have never used the socks libraries so I don't have an exact one to suggest.
if you want to implement the protocol by hand you need to check the related rfc documents or at least
http://en.wikipedia.org/wiki/SOCKS and also the source code of proxymini is very useful to understand it