streama icon indicating copy to clipboard operation
streama copied to clipboard

Sync behind an SSL Proxy

Open AECX opened this issue 5 years ago • 4 comments

Issue description

My Problem: Sync watching does not work behind an SSL Proxy but does behind a "normal" (port 80) proxy... I have checked the docs and tried various configurations including some specific header configurations from other issues but I can't seem to find a solution. Also it is just the sync watching that doesn't work when accessing through an SSL Proxy, the site itself works perfectly fine.

My configuration: apache2:

Header set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'; font-src 'self' data:; style-src 'self' 'unsafe-inline'; img-src 'self' https://image.tmdb.org;"

<VirtualHost *:443>
    SSLProxyEngine On
    ProxyPreserveHost On
    ProxyRequests Off

    ServerName watch.mydomain.com

    SSLEngine On
    SSLCertificateFile  /etc/letsencrypt/live/mydomain.com/cert.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.com/privkey.pem

    ProxyPass / http://127.0.0.1:8080/
    ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>

Steps to Reproduce

  • sorry, no clue

Expected Behaviour

  • the stream should be synced across all users

Actual Behaviour

  • every user with the sync-link will be redirected to the correct video but either start at 0:00 or, if they've watched it earlier, at their timestamp
  • Skipping, pausing, etc. doesn't affect any of the other participants

Environment Information

  • Operating System: Debian 9
  • Streama version: 1.9.2
  • Custom streama build, describe customizations or provide link to fork (If Applicable): -
  • Container Version (If Applicable): -

AECX avatar Oct 26 '20 13:10 AECX

I seem to have this issue too. Wanted to watch a movie with some friends but it never syncs and always starts at 00:00 or resumes at their own timestamp.

I don't suppose you've found a solution in the meantime?

I'm running the same reverse proxy setup on Ubuntu 20.04 and Streama version 1.10.1

LobaDK avatar Feb 14 '21 03:02 LobaDK

Hi, sorry for the delayed response.

Unfortunately no, I haven't found a solution to that particular problem.

However with my new server installation that runs nginx instead of apache this issue is no longer present...

AECX avatar Feb 17 '21 13:02 AECX

I see. Guess I'll have to run Nginx alongside Apache. Thank you for the response though.

LobaDK avatar Feb 18 '21 01:02 LobaDK

So looking further into it, trying to debug the issue with the browsers console, I noticed that movies played with the sync token active fail to connect to a web-socket of some sort, and only appears when using that feature. I've already tried reverse proxying and using rewrite rules on the websocket, but haven't had any luck so far.

I also noticed it fails to send a POST with a 403 error, to https://example.com/stomp/620/kd7fe8k8/xhr_streaming and https://example.com/stomp/620/q9fzuh9g/xhr. Again, only when the sync feature is being used.

I doubt I'll figure something out, but hopefully this may help someone else find a solution.

LobaDK avatar Feb 18 '21 16:02 LobaDK