mirror of
https://github.com/lnbits/lnbits.git
synced 2025-10-05 19:22:34 +02:00
check https for wss
This commit is contained in:
@@ -85,14 +85,24 @@
|
|||||||
},
|
},
|
||||||
created: function () {
|
created: function () {
|
||||||
console.log('{{ copilot.id }}')
|
console.log('{{ copilot.id }}')
|
||||||
|
if (location.protocol !== 'https:') {
|
||||||
|
this.connection = new WebSocket(
|
||||||
|
'ws://' +
|
||||||
|
document.domain +
|
||||||
|
':' +
|
||||||
|
location.port +
|
||||||
|
'/copilot/ws/compose/{{ copilot.id }}'
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
this.connection = new WebSocket(
|
||||||
|
'wss://' +
|
||||||
|
document.domain +
|
||||||
|
':' +
|
||||||
|
location.port +
|
||||||
|
'/copilot/ws/compose/{{ copilot.id }}'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
this.connection = new WebSocket(
|
|
||||||
'ws://' +
|
|
||||||
document.domain +
|
|
||||||
':' +
|
|
||||||
location.port +
|
|
||||||
'/copilot/ws/compose/{{ copilot.id }}'
|
|
||||||
)
|
|
||||||
this.connection.addEventListener('open', function (event) {
|
this.connection.addEventListener('open', function (event) {
|
||||||
this.connection.send('')
|
this.connection.send('')
|
||||||
})
|
})
|
||||||
|
@@ -170,13 +170,23 @@
|
|||||||
created: function () {
|
created: function () {
|
||||||
console.log('{{ copilot.id }}')
|
console.log('{{ copilot.id }}')
|
||||||
|
|
||||||
this.connection = new WebSocket(
|
if (location.protocol !== 'https:') {
|
||||||
'ws://' +
|
this.connection = new WebSocket(
|
||||||
document.domain +
|
'ws://' +
|
||||||
':' +
|
document.domain +
|
||||||
location.port +
|
':' +
|
||||||
'/copilot/ws/panel/{{ copilot.id }}'
|
location.port +
|
||||||
)
|
'/copilot/ws/compose/{{ copilot.id }}'
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
this.connection = new WebSocket(
|
||||||
|
'wss://' +
|
||||||
|
document.domain +
|
||||||
|
':' +
|
||||||
|
location.port +
|
||||||
|
'/copilot/ws/compose/{{ copilot.id }}'
|
||||||
|
)
|
||||||
|
}
|
||||||
this.connection.addEventListener('open', function (event) {})
|
this.connection.addEventListener('open', function (event) {})
|
||||||
|
|
||||||
this.connection.addEventListener('message', function (event) {
|
this.connection.addEventListener('message', function (event) {
|
||||||
|
Reference in New Issue
Block a user