In order to compile it, you can use the GNU C++ compiler, and linking the application with libpthread:
g++ -o socks5 socks5.cpp -lpthreadBy default it only accepts authenticated connections, using the USERNAME define as username, and the PASSWORD define as password. If you want to allow unauthenticated connection requests, add a -DALLOW_NO_AUTH flag when compiling.
The proxy server listens on port 5555, you might as well want to change the SERVER_PORT define if you want it to wait for connections on another port.
The source code can be downloaded from github: https://github.com/mfontanini/Programs-Scripts/blob/master/socks5/socks5.cpp.
Hope you find it useful!