Advertisement
Guest User

Untitled

a guest
Nov 1st, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. var clients = {};
  2.  
  3. var ws = new WebSocketServer.Server({
  4. port: 3000
  5. });
  6.  
  7.  
  8. ws.on('connection', function(ws) {
  9. var id = random(1, 100) // min, - max
  10. clients[id] = ws;
  11. });
  12.  
  13. # ...
  14.  
  15. var clients = {
  16. questions: {
  17. 324: <ws_object>
  18. }
  19. }
  20.  
  21. {type: "auth", login: "user", pass: "password"}
  22.  
  23. {type: "auth", status: false}
  24.  
  25. var clients = {
  26. questions: {
  27. 324: <ws_object>
  28. }
  29. }
  30.  
  31. qid | uid
  32. 324 | 54
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement