peers / peerjs-server

Server for PeerJS
https://peerjs.com
MIT License
4.38k stars 1.09k forks source link

how to return meta data from herokuapp using peer js? #173

Closed veezo2007pk closed 4 years ago

veezo2007pk commented 4 years ago

i have developed video call app with heroku and peer js. I have some problem with return data of heroku app i want some optional to be return from heroku app, but its only return this data

{
    "msg": "Success",
    "users": [
        "shazli"
    ]
}

can i can get any optional data when heroku called?

here is my code

to create peer here is my code i have add meta data here, i need to return this data with use info, which heroku return

peer = new Peer(myPeerID, { host: PEER_SERVER, port: PORT, path: '/', secure: true, metadata:"fwefew" }); and this is my code which is fetching online users, here i need meta data which i have added when created peer

function fetchOnlinePeers() {
        $.ajax("https://" + PEER_SERVER + "/peerjs/" + myPeerID + "/onlineusers")
            .done(function (data) {
                console.log(data.message);
                if (data.msg == 'Success') {
                    console.log(data);

                    data.users.splice(data.users.indexOf(myPeerID), 1)

                myapp.updateOnlieUsers(data.users)
            }
        });
    }
afrokick commented 4 years ago

Sorry, we don't provide a 'metadata' option in a Peer constructor. it is your API, not peerjs