Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit c23e305

Browse files
author
xiandeatintel
authored
Merge pull request #158 from starwarfan/cert-4.2.x
Add click anchor in sample page for testing portal certificate
2 parents 7a584c3 + 0fb4ded commit c23e305

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/samples/conference/public/scripts/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,19 @@ const runSocketIOSample = function() {
196196
console.log('Participants in conference: ' + participants.length);
197197
}, function(err) {
198198
console.error('server connection failed:', err);
199+
if (err.message.indexOf('connect_error:') >= 0) {
200+
const signalingHost = err.message.replace('connect_error:', '');
201+
const signalingUi = 'signaling';
202+
removeUi(signalingUi);
203+
let $p = $(`<div id=${signalingUi}> </div>`);
204+
const anchor = $('<a/>', {
205+
text: 'Click this for testing certificate and refresh',
206+
target: '_blank',
207+
href: `${signalingHost}/socket.io/`
208+
});
209+
anchor.appendTo($p);
210+
$p.appendTo($('body'));
211+
}
199212
});
200213
});
201214
};

src/sdk/conference/signaling.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ export class SioSignaling extends EventModule.EventDispatcher {
7979
this.dispatchEvent(new EventModule.OwtEvent('disconnect'));
8080
}
8181
});
82+
this._socket.on('connect_error', (e) => {
83+
reject(`connect_error:${host}`);
84+
});
8285
this._socket.on('drop', () => {
8386
this._reconnectTimes = reconnectionAttempts;
8487
});

0 commit comments

Comments
 (0)