Attempt to use a base class to support both WebSocket and StubSocket