Jump to content

Websocket connection offline warning


Go to solution Solved by quickmic,

Recommended Posts

sross44
Posted

This may be a one off issue, but I'm setting up Emby for Kodi next gen on a shield pro outside of my home network. In the past this worked flawlessly, but now for some reason I'm getting a Websocket Connection Offline warning every 3 seconds or so. What's even more interesting, if I connect to my Jellyfin server and use the jellyfin plugin for Kodi it doesn't give me that same error. Any ideas as to what could be causing this? I've tried connecting via Emby Connect as well as directly with the server url. 

Any help would be appreciated. 

quickmic
Posted

Quite sure you use a proxy and it's wrongly configured.

Guessing here, the jellyfin plugin will have the same issue, it just not reporting the problem.

sross44
Posted
23 minutes ago, quickmic said:

Quite sure you use a proxy and it's wrongly configured.

Guessing here, the jellyfin plugin will have the same issue, it just not reporting the problem.

I am using nginx... but does it need to be configured specifically for Kodi? Every other application I have running through it, Emby, JF, and a bunch of others all work perfectly. In this instance, isn't Kodi just connecting to the URL? How do I specifically configure it for that? 

  • Solution
quickmic
Posted (edited)
11 minutes ago, sross44 said:

I am using nginx... but does it need to be configured specifically for Kodi? Every other application I have running through it, Emby, JF, and a bunch of others all work perfectly. In this instance, isn't Kodi just connecting to the URL? How do I specifically configure it for that? 

I use apache, so not sure how to configure on nginx but yes. You need to configure websocket. It uses "ws" "wss" (ssl) upgrade protocol. And no, this is not unique to Kodi plugin. This is a standard and every "modern" website uses websockets. btw, also this forum for notification.

Just google nginx websocket and you will find couple of info.

 

  

On 4/24/2023 at 12:23 PM, quickmic said:

It is working via proxy. I also use apache as reverse proxy.

Your config is just no correct. Websocket uses additional parameters, not just http(s).

e.g. for apache you need to configure ws(s)://domain.tld as well. btw h2 is for http2

for nginx, you need check yourself

 

<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerName multimedia.mytld.net
        Protocols h2 http/1.1
        AllowEncodedSlashes NoDecode
        SSLProxyEngine On
        SSLProxyVerify None
        SSLProxyCheckPeerCN Off
        SSLProxyCheckPeerName Off
	SSLProxyCheckPeerExpire off
        ProxyRequests off
        ProxyPreserveHost on

        ProxyPass "/embywebsocket" "wss://192.168.0.207:443/"
        ProxyPassReverse "/embywebsocket/" "wss://192.168.0.207:443/"

        ProxyPass "/" "h2://192.168.0.207:443/"
        ProxyPassReverse "/" "https://192.168.0.207:443/"

        LogLevel warn
        SSLEngine on
        SSLCertificateFile /mnt/storage0/certs/letsencrypt/wildcard.tld.net_certificate.crt
        SSLCertificateKeyFile /mnt/storage0/certs/letsencrypt/wildcard.tld.net_privatekey.pem
</VirtualHost>
</IfModule>

<VirtualHost *:80>
        ServerName multimedia.mytld.net
        LogLevel warn
		RewriteEngine on
		RewriteCond %{REQUEST_SCHEME} =http
		RewriteCond %{SERVER_NAME} =multimedia.mytld.net
		RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
		RewriteCond %{REQUEST_SCHEME} =ws
		RewriteCond %{SERVER_NAME} =multimedia.mytld.net
		RewriteRule ^ wss://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

 

 

Edited by quickmic
quickmic
Posted (edited)

btw, the websocket connection is necessary for realtime updates. They obviously never worked in your setup and that's essential to keep track of progress.

Otherwise content is only synced on Kodi (re) start.

Edited by quickmic
sross44
Posted
6 minutes ago, quickmic said:

I use apache, so not sure how to configure on nginx but yes. You need to configure websocket. It uses "ws" "wss" (ssl) upgrade protocol. And no, this is not unique to Kodi plugin. This is a standard and every "modern" website uses websockets. btw, also this forum for notification.

Just google nginx websocket and you will find couple of info.

 

  

 

You nailed it. It was a stupid mistake on my part for not enabling websocket support on that URL in the proxy. Thanks so much for helping out! 

  • Like 1
sross44
Posted (edited)
11 hours ago, Junias said:

I have the same problem.

@sross44How did you fixed it?

@Junias are you using nginx proxy manager or just a regular version of nginx? I'm using NPM and just had to enable web socket management on the sub domain. 

Edited by sross44
  • 3 weeks later...
Posted

Im using the "normal" nginx on a Synology.

Tested to sent a message from Emby webinterface to the Kodi-Client - this is ok.

 

I just tested another config for nginx, I´ll see if that fixes the errors...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...