Coder Social home page Coder Social logo

Comments (5)

michelle avatar michelle commented on April 28, 2024 1

Hey Ken,

You'll have to edit the server and client side code to recognize those
messages. If you'll notice, we switch on the message type to decide how to
process the message on both sides. Since SUCCESS is not yet a recognized
type, you're getting that message.

Michelle

On Tue, Dec 10, 2013 at 12:16 AM, Ken OKABE [email protected]:

Hi,
basically, I'd like to implement AUTH bootstrap in server.js
PeerServer.prototype._initializeWSS
such as

if (true) // true for auth passed
{
socket.send(JSON.stringify(
{
type: 'SUCCESS',
payload:
{
msg: id + ': Authorizaton Success'
}
}));

            f(); // go on the rest
        }
        else
        {
            socket.send(JSON.stringify(
            {
                type: 'ERROR',
                payload:
                {
                    msg: id + ': Authorizaton Failed'
                }
            }));
            socket.close();
            return;
        }

However, in this sample, I tried
type: 'SUCCESS'
and which is unrecognized message at client side.
WARNING You received an unrecognized message: [object Object]

Having googled for a while to find definition of the type, I could not
find them.
All the type I can find in the server.js code is
type: 'ERROR',
type: 'ID-TAKEN',
and
type: 'OPEN'
seems to do nothing.

I need to grab a server status for my own implementation in the context of
the Connection status:
http://cdn.peerjs.com/demo/chat.html

How can we do this??

I've read
#10 #10
by the way, but no clue.
Thanks.


Reply to this email directly or view it on GitHubhttps://github.com//issues/28
.

from peerjs-server.

ken-okabe avatar ken-okabe commented on April 28, 2024

Michelle,

Thanks for reply.
I investigated only in server side, but found where to tweak in client side.

https://github.com/peers/peerjs/blob/master/lib/peer.js

Thanks!

from peerjs-server.

michelle avatar michelle commented on April 28, 2024

https://github.com/peers/peerjs/blob/master/lib/peer.js#L146

That should be what you're looking for! Good luck.

Michelle

On Tue, Dec 10, 2013 at 12:48 PM, Ken OKABE [email protected]:

Michelle,

Thanks for reply.
I investigated only in server side, but found where to tweak in client
side.

https://github.com/peers/peerjs/blob/master/lib/peer.js

Thanks!


Reply to this email directly or view it on GitHubhttps://github.com//issues/28#issuecomment-30266348
.

from peerjs-server.

ken-okabe avatar ken-okabe commented on April 28, 2024

Thanks again, Michelle.

peer.js is one of the best project around.
Just in case you haven't noticed, one of the major mobile company in Japan - NTT Communications has employed your project.
http://www.us.ntt.com/en/index.html
https://github.com/nttcom
https://github.com/nttcom/peerjs
http://nttcom.github.io/skyway/

Keep up the good work!

from peerjs-server.

michelle avatar michelle commented on April 28, 2024

Thanks for using us! :)

Michelle

On Tue, Dec 10, 2013 at 2:33 PM, Ken OKABE [email protected] wrote:

Thanks again, Michelle.

peer.js is one of the best project around.
Just in case you haven't noticed, one of the major mobile company in Japan

Keep up the good work!


Reply to this email directly or view it on GitHubhttps://github.com//issues/28#issuecomment-30275281
.

from peerjs-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.