I finding a simple solution to use WebSocket with custom headers for web app based on PHP as backend and js+vuejs as frontend.
My app should connect to WebSocket server
I'm so confused at the massive amount of mis-information of websockets and headers. There is a way to add headers to WebSocket connections.
Like this
options.headers= {"header1":"value"} const socket = new WebSocket('wss://yourwebsocketAPIpath', [],options )