Skip to content

Commit

Permalink
Add ws:// and wss:// handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jmkao committed Dec 6, 2020
1 parent 1ad5312 commit 2b80757
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/layouts/MainLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,18 @@ export default {
},
connectOBS () {
this.initOBS()
this.obs.connect({ address: this.obsAddress })
let secure = false
let parsedAddress = this.obsAddress
if (this.obsAddress.startsWith('wss://')) {
secure = true
parsedAddress = this.obsAddress.slice(6)
} else if (this.obsAddress.startsWith('ws://')) {
secure = false
parsedAddress = this.obsAddress.slice(5)
}
this.obs.connect({ address: parsedAddress, secure })
.catch(err => {
this.onOBSError(err)
})
Expand Down

0 comments on commit 2b80757

Please sign in to comment.