I'd like to periodicity check if my SOCKS server is working fine. In order to do that, I thought of pinging 8.8.8.8 (google DNS server) through the SOCKS server.
Is there other recommended way? If it's optimal, how can I ping through SOCKS with python?
A SOCKS proxy provides a TCP proxy service (SOCKS 5 added UDP Support). You cannot perform an ICMP Echo "via" a SOCKS proxy service.
Even if you could, you would be testing ICMP Echo and Echo Reply, and not that your SOCKS server is running fine.
If you want to test that your SOCKS server is "running fine" I'd suggest that you open local listening port and then try to connect to it via the SOCKS service.