Updated the documentation for include support for headers and onclose parameters

This pull request updates the documentation to include support for the proposed new features:
* Custom headers when connecting
* Extra _code_ and _reason_ parameters for the _onclose_ callback