Added Support for Endpoints

Added support for custom endpoints. You can call connectToEndpoint() to switch to a new endpoint and sendDisconnect() to disconnect from an endpoint. Also added a listener event which will trigger whenever the socket switches endpoints.