This is the fix to the problem I see a lot of you are having with the WebSocket client and is not included in the docs. Just npm install and import babel-polyfill.
import Ws from '@adonisjs/websocket-client'
import Vue from 'vue'
// production change ws:// to wss:// for security
var ws = Ws('ws://localhost:3333')
ws.connect()
ws.on('open', () => {
alert('Connected to server.')
})
This is the fix to the problem I see a lot of you are having with the WebSocket client and is not included in the docs. Just npm install and import babel-polyfill.