Created
July 25, 2013 03:44
-
-
Save kruyvanna/6076763 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var host = window.location.hostname; | |
var port = 3001; | |
var serverAddress = host + ":" + port; | |
console.log('serverAddress:' + serverAddress); | |
var websocket = new WebSocket("ws:" + serverAddress); | |
websocket.onmessage = function(message){ | |
console.log('onmessage: ', message); | |
if(message.data === "jump"){ | |
stage.click(); | |
} | |
}; | |
websocket.onerror = function(message){ | |
console.log('onerror: ' + message); | |
} | |
websocket.onopen = function(message){ | |
console.log('onopen', message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment