Fixes #1.

Also exposed the client socket to the user.