|
@@ -5,7 +5,7 @@
|
|
|
|
|
|
## Class: peerjs.Peer
|
|
## Class: peerjs.Peer
|
|
|
|
|
|
-This class is a the BinaryJS websocket server. It is an `EventEmitter`.
|
|
|
|
|
|
+This class is a Peer, which can connect to other peers and listen for connections. It is an `EventEmitter`.
|
|
|
|
|
|
### new Peer([id], [options])
|
|
### new Peer([id], [options])
|
|
|
|
|
|
@@ -118,7 +118,9 @@ for no serialization. Default serialization format is `binary`.
|
|
|
|
|
|
Accepts data of any JSON type or binary type.
|
|
Accepts data of any JSON type or binary type.
|
|
|
|
|
|
-Data is serialized using BinaryPack and then sent to the remote peer.
|
|
|
|
|
|
+To configure which serialization format to use, specify `binary`, `json`, or `none` as the `serialization` property of the `options` object in `peer.connect`.
|
|
|
|
+
|
|
|
|
+Data is serialized using BinaryPack (`binary`) by default and then sent to the remote peer.
|
|
|
|
|
|
### connection.close()
|
|
### connection.close()
|
|
|
|
|