To use curl through socks5 proxy, use
curl -v -x socks5://PROXY_SERVER_IP:PROXY_PORT http://checkip.amazonaws.com
if your proxy server require username and password, use
curl -v -x socks5://user:password@PROXY_SERVER_IP:PROXY_PORT http://checkip.amazonaws.com
Example