check https for wss
This commit is contained in:
parent
412ac8d110
commit
589a482faa
2 changed files with 34 additions and 14 deletions
|
|
@ -85,14 +85,24 @@
|
|||
},
|
||||
created: function () {
|
||||
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.send('')
|
||||
})
|
||||
|
|
|
|||
|
|
@ -170,13 +170,23 @@
|
|||
created: function () {
|
||||
console.log('{{ copilot.id }}')
|
||||
|
||||
this.connection = new WebSocket(
|
||||
'ws://' +
|
||||
document.domain +
|
||||
':' +
|
||||
location.port +
|
||||
'/copilot/ws/panel/{{ 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.addEventListener('open', function (event) {})
|
||||
|
||||
this.connection.addEventListener('message', function (event) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue