There is currently a bug in Stack Overflow JS that leads to realtime updates failure.
I load SO pages through HTTPS; e.g. Active questions for a tag, like https://stackoverflow.com/questions/tagged/google-chrome-extension?sort=active
This normally works, as well as realtime updating: first connection to the realtime updates endpoint is made through wss:
regardless of the page's protocol:
wss://qa.sockets.stackexchange.com/
However, as the page stays up, the code decides to switch to ws:
, again, regardless of the page's protocol:
ws://qa.sockets.stackexchange.com/
This reset seems to happen after 5 minutes of inactivity in the tag and leads to 2 distinct problems.
When loading the page over HTTPS, Chrome simply refuses to allow the connection and realtime updates break:
[blocked] The page at 'https://stackoverflow.com/questions/tagged/google-chrome-extension?sort=active&pageSize=50' was loaded over HTTPS, but ran insecure content from 'ws://qa.sockets.stackexchange.com/': this content should also be loaded over HTTPS.
The script does not recover from this and updates stop.
My workplace is behind a transparent squid proxy. This breaks insecure WebSockets, so accessing the page over HTTP just leads to connection errors when
ws:
endpoint is accessed:WebSocket connection to 'ws://qa.sockets.stackexchange.com/' failed: Error in connection establishment: net::ERR_TUNNEL_CONNECTION_FAILED
However, the script
does recoversometimes recovers from that and reconnects throughwss:
automatically.
Please note: I'm reasonably sure this worked before (about a month before). In any case, the connection should not downgrade to ws:
.