mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 20:25:48 +00:00
Change from ws.on('message') to ws.onmessage for browser compat.
This commit is contained in:
@@ -385,15 +385,14 @@ Remote.prototype._connect_start = function () {
|
||||
|
||||
self._connect_retry();
|
||||
};
|
||||
|
||||
// Node's ws module doesn't pass arguments to onmessage.
|
||||
ws.on('message', function (json, flags) {
|
||||
self._connect_message(ws, json, flags);
|
||||
});
|
||||
|
||||
ws.onmessage = function (json) {
|
||||
self._connect_message(ws, json.data);
|
||||
};
|
||||
};
|
||||
|
||||
// It is possible for messages to be dispatched after the connection is closed.
|
||||
Remote.prototype._connect_message = function (ws, json, flags) {
|
||||
Remote.prototype._connect_message = function (ws, json) {
|
||||
var message = JSON.parse(json);
|
||||
var unexpected = false;
|
||||
var request;
|
||||
|
||||
Reference in New Issue
Block a user