I want to use
Websockets in my website, so I read the related topic in
but some of it’s descriptions are not clear to me. according to docs:
and then import it as follows
import Ws from '@adonisjs/websocket-client' const ws = Ws('ws://localhost:3333')
Where should I use this line of code ? ( front ? backend ? )
import Ws from '@adonisjs/websocket-client'
because as far as I know
import is es6 syntax and it’s not supported well in browsers.
The module build requires regenerator-runtime polyfill, so make sure to add it via babel.
I installed it, but don’t know how to use it.
Can someone please help me.