Skip to content

Commit

Permalink
patch socket-stream-client
Browse files Browse the repository at this point in the history
Removes `xdr`, `iframe` & `jsonp` type transports from sockjs.

Wraps `forEachCallback` to prevent errors in the `message` handlers from breaking the client
  • Loading branch information
nathan-muir committed Oct 17, 2023
1 parent 16a79eb commit 5cbbb28
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 1 addition & 6 deletions packages/socket-stream-client/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,7 @@ export class ClientStream extends StreamClientCommon {
_sockjsProtocolsWhitelist() {
// only allow polling protocols. no streaming. streaming
// makes safari spin.
var protocolsWhitelist = [
'xdr-polling',
'xhr-polling',
'iframe-xhr-polling',
'jsonp-polling'
];
var protocolsWhitelist = ['xhr-polling'];

// iOS 4 and 5 and below crash when using websockets over certain
// proxies. this seems to be resolved with iOS 6. eg
Expand Down
8 changes: 7 additions & 1 deletion packages/socket-stream-client/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ export class StreamClientCommon {
return;
}

this.eventCallbacks[name].forEach(cb);
this.eventCallbacks[name].forEach(function(eventCallback) {
try {
cb(eventCallback)
} catch (err) {
Meteor._debug('SocketStreamClient error in "' + name + '" callback', err);
}
});
}

_initCommon(options) {
Expand Down

0 comments on commit 5cbbb28

Please sign in to comment.