Fix webSocket address bug
This commit is contained in:
parent
28d223c109
commit
457c96fe3c
|
|
@ -38,7 +38,7 @@ export function createApp (app) {
|
||||||
let initialWebsocketOpenend = true
|
let initialWebsocketOpenend = true
|
||||||
function initWebsocket () {
|
function initWebsocket () {
|
||||||
// use the native websocket implementation of browser to communicate with backend
|
// use the native websocket implementation of browser to communicate with backend
|
||||||
socket = new WebSocket('ws://localhost:100/websocket')
|
socket = new WebSocket(`ws://${location.host}/websocket`)
|
||||||
|
|
||||||
socket.addEventListener('open', (event) => {
|
socket.addEventListener('open', (event) => {
|
||||||
console.log('websocket opened')
|
console.log('websocket opened')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue