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