R
R
Rostislav Ignatenko2017-05-17 13:44:51
JavaScript
Rostislav Ignatenko, 2017-05-17 13:44:51

Socket io on the client side?

There is an app on node+socket.io . Suppose the client has a js file containing a socket connection and the following message

socket.on('join', function(nickname) {
        socket.nickname = nickname;
        socket.broadcast.emit('notice', nickname + ' has joined the chat.');
      });

Questions:
1) How to make sure that the user cannot change the js code in his developer tool in the browser (I saw this on some sites)
2) Why if I forcefully write test instead of join in the developer tool, everything still works fine and performs what it was before the changes? Does it somehow cache the server-client interaction for itself? Or is it because these functions themselves are executed in document.ready and js itself caches this for itself?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Korobkov, 2017-05-17
@lepard

1. Not at all
2. Because the code was already executed before it was changed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question