Socket(url: String, opts: Options = Socket.Options())
Socket main constructor.
This class is a thin layer above websockets. This layer provides compatibility with Phoenix Sockets. It handle heartbeat, serialization and provides a simple event based API.
When using Phoenix, you will usually not push messages directly to sockets but use Channels instead.
The url can use either the ws://
or wss://
scheme.