Pwntools is an immensely powerful framework used primarily for binary exploitation, but I have also used it for an challenges that require sockets due to how simplified such interactions are with it.
Here we will be using the python version of pwntools, though there is also a ruby version.