Add connection callback

The connection callback allows us to initialise TLS, if required, before handshaking the WebSocket. This allows us to connect to WebSocket servers fronted by stunnel/tls.