Created
December 2, 2013 18:08
-
-
Save risacher/7753727 to your computer and use it in GitHub Desktop.
Example of how to use the user.js file in tty.js, to do something somewhat useful. This appends the io.socket transport type into the help text. I use this to know whether I've got websockets actually working on any given day.
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
if (window.tty) { | |
tty.on('open', function() { | |
var tty = window.tty; | |
window.tty.socket.on('connect', function() { | |
console.log('connect ',window.tty.socket.socket.transport.name); | |
document.getElementById('help').innerHTML += "<p>" + window.tty.socket.socket.transport.name; | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment