This was originally reported to pycurl: pycurl/pycurl#392
Test program in C: https://github.com/p/test-repo/blob/master/libcurl/socksproxybug.c reproduces the bug against libcurl master.
@fuchaoqun can provide the public test IP.
Even though proxy port changes between requests, libcurl reuses the connection which means the second request is sent to the first proxy.