peers/peerjs — pull request #195 by yemel (2014-05-21 20:18:09+00:00)
Title: Expose connection token in Peer options

Hi there,

At [BitPay](https://bitpay.com/) we are using PeerJS to build a serverless multi-signature bitcoin wallet, called [Copay](https://github.com/bitpay/copay).

Since each wallet have their own ID, which is used as the Peer ID, we have to provide a resilient way for reconnecting the user after a sudden disconnection. As you may be aware **it's not always possible** to have a graceful disconnection - sending a 'disconnect' message -, therefore the user must wait until the server times out to connect again with the same ID.

In this pull request we expose the server's connection token in the Peer options object in order to offer a way to store it and later reestablish the communication gracefully.

All the comments and suggestions are welcome. Btw, thanks for building such a good project.