Sfoglia il codice sorgente

more details on serialization format

Michelle Bu 12 anni fa
parent
commit
a60ddb8394
1 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  1. 4 2
      docs/api.md

+ 4 - 2
docs/api.md

@@ -5,7 +5,7 @@
 
 ## 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])
 
@@ -118,7 +118,9 @@ for no serialization. Default serialization format is `binary`.
 
 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()