I'm posting this on AskUbuntu because "easiest" in my case includes giving preference to solutions depending only on software available in the default Ubuntu repositories. (to be more accurate, 12.04)
I am currently developing an application that accesses web APIs and would like to test whether proxy support is working. Ideally, I would like to run a local server and simply tell my application to access the proxy in localhost.
The catch is that my application supports SOCKS4, SOCKS5, and HTTP proxies, and I would like to test all possible error cases. This means:
- sending a SOCKS5/HTTP request to a SOCKS4 server must not work
- sending a SOCKS4/HTTP request to a SOCKS5 server must not work
- sending a SOCKS5/SOCKS5 request to a HTTP server must not work
(all cases both with and without authentication)
So I can't use ssh -D for SOCKS, for example, because it automagically accepts both SOCKS4 and SOCCKS5 connections.