Wednesday 31 May 2017

how to retrieve other-peers-id using PeerServer

I want to make a video chat application using peerJs and PeerServer. I am passing an ID which is randomly generated when creating a peer constructor. This is what I have on the client side

        var generatedID = $('#my_id').text();

        var peer = new Peer( generatedID , { host: 'localhost', port: 7880, path: '/' });

and then I create a connection, from their documentation in GitHub, we pass the other peer's id to initialize the connection.

        var conn = peer.connect('another-peers-id');
        conn.on('open', function(){
              // the the logic here
        });

Now, I am wondering how to obtain the other peer's id.



via Danny

No comments:

Post a Comment