fix send WebSocket authentication messages
This commit is contained in:
		@@ -60,6 +60,8 @@ Sumorobot.prototype.connect = function() {
 | 
				
			|||||||
    /* when the WebSocket gets connected */
 | 
					    /* when the WebSocket gets connected */
 | 
				
			||||||
    this.websocket.onopen = function(evt) {
 | 
					    this.websocket.onopen = function(evt) {
 | 
				
			||||||
        console.log("INFO websocket connected");
 | 
					        console.log("INFO websocket connected");
 | 
				
			||||||
 | 
					        // send authentication message
 | 
				
			||||||
 | 
					        sumorobot.send('{"setID": "browser-' + robotId + '@00000514", "passwd": "salakala"}');
 | 
				
			||||||
        /* setup a timer to ping the robot */
 | 
					        /* setup a timer to ping the robot */
 | 
				
			||||||
        self.watchdogTimer = setInterval(function() {
 | 
					        self.watchdogTimer = setInterval(function() {
 | 
				
			||||||
            /* send a ping to the robot */
 | 
					            /* send a ping to the robot */
 | 
				
			||||||
@@ -561,7 +563,6 @@ window.onload = function() {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        /* connect to the selected robots WebSocket */
 | 
					        /* connect to the selected robots WebSocket */
 | 
				
			||||||
        sumorobot = new Sumorobot("ws://" + robotServer);
 | 
					        sumorobot = new Sumorobot("ws://" + robotServer);
 | 
				
			||||||
        sumorobot.send('{"setID": "browser-' + robotId + '@00000514", "passwd": "salakala"}');
 | 
					 | 
				
			||||||
        /* connect to the other block highlight WebSocket */
 | 
					        /* connect to the other block highlight WebSocket */
 | 
				
			||||||
        /*blockHighlight = new WebSocket("ws://" + robotServer + ":80/p2p/browser/" + robotId + "-highlight/");
 | 
					        /*blockHighlight = new WebSocket("ws://" + robotServer + ":80/p2p/browser/" + robotId + "-highlight/");
 | 
				
			||||||
        // when there is a message from the WebSocket
 | 
					        // when there is a message from the WebSocket
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user