removed double onconnecting fire during reconnect
Merge pull request #22 from artfulhacker/master

removed double onconnecting fire during reconnect
Fix spelling typo in comments.
Support 'code' and 'reason' arguments of WebSocket.close
Copy CONNECTING, OPEN, CLOSING, CLOSED properties from WebSocket

This increases compatibility as a drop-in replacement.

eg:

    var SocketType = useReconnecting ? ReconnectingWebSocket : WebSocket;

    SocketType.CONNECTING
Document some API differences between WebSocket and ReconnectingWebSocket.

https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
Remove some non-standard properties from the interface.

These are not present on WebSocket. They only shadow constructor arguments
so clients who need them can stash them on the object directly themselves.

Note:

- `protocols` is a list of protocols. WebSocket sets the `protocol`
  (singular) property to reflect the selected protocol.
- `URL` is a redundant duplicate of the `url` property.
Support the `protocol` property.
Document sections and reorder slightly to group.
Function onconnecting does not have an argument.
Move default event handlers to prototype.

Allows user to delete their handlers without causing exceptions later.
Add support for handling events via addEventListener.

This allows multiple listeners, for example.
Add API documentation.
Add TypeScript declaration for ReconnectingWebSocket class.
Merge pull request #26 from drewnoakes/master

API compatibility and documentation
Merge pull request #1 from joewalnes/master

test