test stuff

beta.r3js.org
-=ybafelo 2018-08-31 15:04:19 +02:00
parent ae20cb579d
commit ccc41e1eb3
1 changed files with 10 additions and 0 deletions

View File

@ -63,6 +63,16 @@ R3.Socket.prototype.createInstance = function() {
this.instance = new WebSocket(this.server.getURL());
// Connection opened
this.instance.addEventListener('open', function (event) {
this.instance.send('Hello Server!');
}.bind(this));
// Listen for messages
this.instance.addEventListener('message', function (event) {
console.log('Message from server ', event.data);
});
R3.Component.prototype.createInstance.call(this);
};