Satch3000
Satch3000

Reputation: 49384

PeerJS Set your own PeerID

I am trying out PeerJS and it works great.

Just looking at the demo's the Peer ID is auto created for you.

Is there a way to define / set your own Peer Id?

Upvotes: 2

Views: 5638

Answers (1)

Dan D.
Dan D.

Reputation: 74645

Provide a peer id when you create the peer object:

var peer = new Peer('pick-an-id', {key: 'myapikey'}); 
// You can pick your own id or omit the id if you want to get a random one from the server.

This is right off the page you linked to under Create a peer.

Upvotes: 6

Related Questions