connect method
opens a connection to the server
onConnect
is called once there's a connect response from the server
Implementation
Future<void> connect(Function(W3GResponse) onConnect) async {
on("connect", onConnect);
send({"path": "connect"});
}