fermi-ad / parameter_page_app

Web application implementing the Parameter Page.
MIT License
2 stars 1 forks source link

Chrome can't initiate a web-socket connection when subscribing to DPM data #145

Closed cnlklink closed 10 months ago

cnlklink commented 12 months ago

Chrome won't initiate a web-socket connection to the DPM API when subscribing to DPM data. This is the error message returned & displayed in the developer tools console:

WebSocket connection to 'ws://localhost:8000/acsys' failed: Error during WebSocket handshake: Response must not include 'Sec-WebSocket-Protocol' header if not present in request: graphql-ws

@rneswold reports that this error does not occur in a MacOS build of the application.

I can report that Firefox does not have this problem.

To Reproduce

  1. Port forward localhost:8000 to acsys-proxy:8000
  2. Launch the application with flutter run -d chrome
  3. Create a new parameter page and place M:OUTTMP on it, exit edit mode
  4. Open developer tools console, you should see the error reported at 1hz
beauremus commented 10 months ago

Chrome is strict about how this handshake happens. If I understand correctly, it requires the client to send the protocol in the initial request, whereas other browsers allow the client to choose from the server response protocol later in the handshake.

PR #160 closes this issue by sending the protocol in the initial request.