Kodi Community Forum
Lost websocket connection - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Web Interfaces (https://forum.kodi.tv/forumdisplay.php?fid=156)
+----- Forum: Chorus 2 (https://forum.kodi.tv/forumdisplay.php?fid=268)
----- Thread: Lost websocket connection (/showthread.php?tid=308456)

Pages: 1 2

Lost websocket connection - DirtyDogg - 2017-03-01

I am getting a websocket error while using chorus 2. It happens nearly every time I use chorus 2 to control my kodi installation. Any ideas how to resolve this?

RE: Lost websocket connection - tripkip - 2017-03-01

Same issue.

Update - I found the cause of my issue. My webserver port was set to 9090, which is the same port Kodi uses for the websockets server.
Cange your webserver port to something else in the services settings and see if that helps.

RE: Lost websocket connection - DirtyDogg - 2017-03-02

Unfortunately that isn't the same issue for me Sad
Some more information
Windows 10 x64
Kodi 17.1RC

I have tried multiple ports
opening both the web port and 9090 in the firewall
disabling the firewall

I get better results on chrome and edge(lost web sockets connection followed by a reconnecting message) after a few seconds the currently playing song will update.
Safari and IE(heh) never seem to reconnect or update the currently playing track.

RE: Lost websocket connection - swrobel - 2017-03-22

I'm also having this issue:

Kodi 17.1 final
macOS 10.12.3

Working correctly in Safari 10.0.3 (no websocket error message)

All of the following browsers show "Lost websocket connection":
  • Firefox 52.0.1 ("Firefox can’t establish a connection to the server at ws://")
  • Chrome 57.0.2987.110 ("WebSocket connection to 'ws://' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED")
  • Opera 44.0.2510.857 (same console error message as chrome)
  • Vivaldi 1.7.735.46 (same console error message as chrome)

Possibly related to this bug

RE: Lost websocket connection - ChristoSnake - 2017-04-23

I've got the same issue with Kodi v17.1 on Firefox v52.0.2...

Being a newbie, I guess I'll do more watching than contributing on this one Tongue

RE: Lost websocket connection - nojoe - 2017-08-23

Also here on a rpi3 + LibreElec 8.1.0 (Kodi 17.4), 1Gb LAN.
Doesn't matter which Browser i use. Any hint?

RE: Lost websocket connection - Mizaki - 2017-10-07

Reverting to 17.3 fixes the websocket problem. So, looks like a change between 17.3 and 17.4 and not really related to Chorus2.

RE: Lost websocket connection - CrustyCurmudgeon - 2019-01-27

Still having this same issue with Kodi 17.6. Seeing repeated messages with both chrome and firefox. Any movement or solutions at all??

RE: Lost websocket connection - semolina - 2019-03-08

Same here for v 18.1 running on mac os.
Happens with all Browsers all the time.

RE: Lost websocket connection - JumboMumbo - 2019-09-11

I get the same in my Docker Kodi.

RE: Lost websocket connection - gomurr - 2019-10-18

Is there something new about the lost websocket issue?
I have still the same problem with Kodi 18.4.
Using Kodi via Webinterface is really useless since long time already :-(

RE: Lost websocket connection - wasawasa - 2020-01-25

(2019-10-18, 10:19)gomurr Wrote: Is there something new about the lost websocket issue?
I have still the same problem with Kodi 18.4.
Using Kodi via Webinterface is really useless since long time already :-(

I think it's a configuration problem. The web interface and websockets are working.

If "Allow remote control via HTTP" is activated, the web server is accessible from remote. However, the websockets are bound to localhost and therefore not accessible from remote. If you activate "Allow remote control from applications on other systems", the port for the websockets (9090) is also accessible from remote. 
You can check this with "lsof -i".
Somehow not quite logical.

RE: Lost websocket connection - DjZU - 2020-04-29

I run into the same problem and could solve it.

Make sure that your firewall is allowing incoming traffic for the EventServer listening on the UDP port 9777 (this is the default port as seen in your 'guisettings.xml' file in 'userdata' folder). See https://kodi.wiki/view/EventServer#Event_Clients_and_the_EventServer

Make sure that your firewall is allowing incoming traffic for the JSON-RPC API listening on the TCP port 9090 by default. See https://kodi.wiki/view/JSON-RPC_API#WebSocket
If you ever changed this port in your 'advancedsettings.xml' file in 'userdata' folder (see https://kodi.wiki/view/Advancedsettings.xml#jsonrpc), then you also have to give the same value to 'socketsPort:' on line 31 at this time in the file 'kodi-webinterface.js' located in '/usr/share/kodi/addons/webinterface.default/js/' for Linux. Note that this file may be replaced and your change erased in case of Kodi update.

I also posted this answer on https://github.com/xbmc/chorus2/issues/274#issuecomment-621379839

RE: Lost websocket connection - donbrew - 2021-12-12

#12 is the solution

RE: Lost websocket connection - eldakka - 2022-01-20

(2021-12-12, 00:13)donbrew Wrote: #12 is the solution

Can confirm.

I've had this issue for years but just ignored it, as it'd just throw up an error popup on idle sessions that refreshing would get rid of, but could see in the bottom right hand corner messages "websocket connection lost, retrying", but since it didn't seem to break anything, as I said, I ignored it.

Found this thread 5 days ago and implemented #12, and no popup errors on idle sessions or the "lost websocket" messages in the lower right hand corner in the 5 days since implementing.

Awesome, thanks!

This forum uses Lukasz Tkacz MyBB addons.