Adds fixes for supporting require('ws') as a client.