Sans-I/O implementation of SOCKS4, SOCKS4A, and SOCKS5.
Low maintenance activity. Last release over 6 years ago, commits in 3 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install socksioSOCKSIO
Client-side sans-I/O SOCKS proxy implementation. Supports SOCKS4, SOCKS4A, and SOCKS5.
socksio is a sans-I/O library similar to
h11 or
h2, this means the library itself
does not handle the actual sending of the bytes through the network, it only
deals with the implementation details of the SOCKS protocols so you can use
it in any I/O library you want.
Current status: stable
Features not yet implemented:
- SOCKS5 GSS-API authentication.
- SOCKS5 UDP associate requests.
Usage
TL;DR check the examples directory.
Being sans-I/O means that in order to test socksio you need an I/O library.
And the most basic I/O is, of course, the standard library's socket module.
You'll need to know ahead of time the type of SOCKS proxy you want to connect to. Assuming we have a SOCKS4 proxy running in our machine on port 8080, we will first create a connection to it:
import socket
sock = socket.create_connection(("localhost", 8080))
socksio exposes modules for SOCKS4, SOCKS4A and SOCKS5, each of them includes
a Connection class:
from socksio import socks4
# The SOCKS4 protocol requires a `user_id` to be supplied.
conn = socks4.SOCKS4Connection(user_id=b"socksio")
Since socksio is a sans-I/O library, we will use the socket to send and
receive data to our SOCKS4 proxy. The raw data, however, will be created and
parsed by our SOCKS4Connection.