Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Https is not properly detected #42

Open
lohmatij opened this issue Nov 10, 2024 · 7 comments
Open

Https is not properly detected #42

lohmatij opened this issue Nov 10, 2024 · 7 comments

Comments

@lohmatij
Copy link

I serve stremio server behind a reverse-proxy with https

My server is available at:
https://stremio.server.com

if I open app.strem.io and specify https://stremio.server.com/ as my server then everything works perfectly

if I open https://stremio.server.com/ then the server is pre-populated to http://stremio.server.com/ (http instead of https) and the app doesn’t work.

If it’s not possible to detect http/https then I suggest to add a separate environment setting to provide a proper url.

@yxtay
Copy link

yxtay commented Nov 11, 2024

Which port did you forward to your reverse proxy? I think you need to forward the https port (12470) instead of the http port (11470) to ensure that the auto redirect. works.

This will probably also require you to skip the tls verify in your reverse proxy. Alternatively, you can generate the tls cert with the /get-https?ipAddress=<ip_address> route and use the self-signed certificate with the wildcard domain (*.519b6502d940.stremio.rocks). Replace * with your ip address (192-168-0-2, with dots replaced with dashes).

Alternatively, use this other docker image which has everything assembled.
tsaridas/stremio-docker

As an example, this is in my Caddyfile. I am not familiar with other reverse proxy, so will not be able to help you.

	@stremio host stremio.{$DOMAIN}
	handle @stremio {
		reverse_proxy https://stremio:12470 {
			transport http {
                                # to use https transport to stremio container
				tls_server_name 192-168-0-2.519b6502d940.stremio.rocks
                                # alternatively to skip tls cert check
                                # tls_insecure_skip_verify
			}
		}
	}

The streaming server shows "Online" in my setup, but still jumps to "Error" at times, so I am not confident my configuration is working 100%.

@fopina
Copy link

fopina commented Dec 31, 2024

I have the same issue and I don’t want to use stremio https port as there is no need for tls between traefik and stremio.
Reverse proxies set X-Forward-Protocol header precisely for this case, the redirect code should check it too, not only which port it came from

I’ve tried looking for server.js GitHub to open PR but I cannot find it. Where is it?

@yxtay
Copy link

yxtay commented Dec 31, 2024

I believe it comes from here.

https://github.com/Stremio/stremio-service/blob/master/src/server.rs

@fopina
Copy link

fopina commented Dec 31, 2024

Does it? Using default port 11470 as a random search criteria, I don’t find it mentioned in that repo, it doesn’t look the same as that server.js
Also, there’s no workflow or doc saying how to build the wasm js in the repo.
And, if it was that service, why use a wasm JS file in this repo (docker) when you can just use the rust binary…?

@yxtay
Copy link

yxtay commented Jan 1, 2025

I'm not familiar. The following issue also discussed the sources

#27

@fopina
Copy link

fopina commented Jan 1, 2025

Thank you! I’ll follow up on that one

@fopina
Copy link

fopina commented Jan 3, 2025

More related to this one than #27 so posting it here: I've applied a small patch to server.js when building docker image, this one to also consider the X-Forward-Proto header.

Not sure how to submit such changes/requests to this file..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants