httpwatcher icon indicating copy to clipboard operation
httpwatcher copied to clipboard

Error during WebSocket handshake: Unexpected response code: 403

Open irdroid3 opened this issue 5 years ago • 7 comments

When looking for errors in my html... I spotted these in the Chrome developer logs :

Message 1 : WebSocket connection to 'ws://cap-wb1:1080/httpwatcher' failed: Error during WebSocket handshake: Unexpected response code: 403

Expanded that message twisty and I see :

  • open @ httpwatcher.min.js:formatted:140
  • (anonymous) @ httpwatcher.min.js:formatted:185 On the right of the above message, it has : httpwatcher.min.js:formatted:140

Message 2 : WebSocket error: [object CustomEvent]

This message does not have a twisty to expand. On the right of the above message, it has : httpwatcher.min.js:formatted:51

In the sources panel for httpwatcher.min.js, it has these for the above line numbers - Line 51 = console.log("WebSocket error: " + e) Line 140 = if (l = new WebSocket(s.url,t || []), Line 185 = s.open(!0)

I am not sure how much of an issue this is; just that I like to see no errors in logs... I have yet to fathom how often this happens - I started the page earlier this afternoon and I now have 389 errors showing on the page in chrome (late afternoon) - probably dependent on how often the page is refreshing itself? - but that seems too often for that.

Any ideas? Cheers, Ian .

irdroid3 avatar Jan 13 '21 17:01 irdroid3

The 403 errors were in a browser on the same Raspberry Pi - running a small Kiosk app... The kiosk has stayed up longer now that I have stopped the 403 messages appearing - I think, as memory is tight on a the RPi0W, I need to stop all such things that can eat up log space etc... See my update to the server.py : https://github.com/irdroid3/httpwatcher/blob/master/httpwatcher/server.py

irdroid3 avatar Feb 02 '21 17:02 irdroid3

Hey there, could you test this issue against the current dev branch and see if it still persists?

jobveldhuis avatar May 23 '21 21:05 jobveldhuis

Will do (sorry for the delay), thank you. Edit : What is the best way to install the Dev code? - any pip method ? or copy the 4 *.py files into : ~/.local/lib/python3.7/site-packages/httpwatcher/

irdroid3 avatar Jun 24 '21 10:06 irdroid3

Hi Job (@jobveldhuis), I just copied the server.py in from dev and I do not see 403 errors now!!! - Many thanks

irdroid3 avatar Jun 24 '21 15:06 irdroid3

Brilliant. I will be working closely with @thanethomson to make sure this also lands at the packaging index, so you can just update your installed module.

jobveldhuis avatar Jun 24 '21 20:06 jobveldhuis

I'm running into something similar. Looks like it's fixed by #6, but that hasn't been released yet.

AstraLuma avatar May 10 '23 20:05 AstraLuma

Yeah this should solve that. Unfortunately, I cannot release new versions of this to Pypi. @thanethomson do you have time to draft a new release?

jobveldhuis avatar May 10 '23 20:05 jobveldhuis