used websocket protocol should match the http one
This commit is contained in:
parent
b16b2a738c
commit
789ef35bb7
|
@ -20,9 +20,10 @@ function setupConnection() {
|
||||||
Setup a connection to receive all the information
|
Setup a connection to receive all the information
|
||||||
about the webhooks in real-time.
|
about the webhooks in real-time.
|
||||||
*/
|
*/
|
||||||
|
let protocol = document.location.protocol == "https:" ? "wss://" : "ws://";
|
||||||
let callbackCode = getCallbackCode();
|
let callbackCode = getCallbackCode();
|
||||||
let webhookSocket = new WebSocket(
|
let webhookSocket = new WebSocket(
|
||||||
"ws://" + window.location.host + "/ws/callback/" + callbackCode + "/"
|
protocol + window.location.host + "/ws/callback/" + callbackCode + "/"
|
||||||
);
|
);
|
||||||
|
|
||||||
webhookSocket.onmessage = function(event) {
|
webhookSocket.onmessage = function(event) {
|
||||||
|
|
Loading…
Reference in New Issue