+ // The Socks5ClientSocket constructor (invoked by socksClient.createConnection) adds an 'error' event listener to the original socket. That behaviour needs to be mimicked by adding a similar listener to the cleartext stream, which replaces the original socket.