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

Proxy configured to be on a domain, the port blocks further requests #11

Open
alekorhonen opened this issue Dec 16, 2021 · 3 comments
Open

Comments

@alekorhonen
Copy link

I've setup the proxy to run on port 8080 and the host is targeted at a subdomain.

I can nicely load the manifest file, but every url that it points to after that includes the port in the URL. So instead of proxy.mydomain.com it becomes proxy.mydomain.com:8080 which is an invalid request.

I did a really dirty workaround for now, which was that I modified the host value in start_http.js just to replace the :8080 out of there.

@warren-bank
Copy link
Owner

Hi. I don't understand your situation.

Are you running the proxy at: http://proxy.mydomain.com:8080?

What are some example URLs for:

  • master manifest
  • child manifest (in master)
  • ts video file (in child)

What are the encoded URLs (directed through proxy) for each example?
How are they incorrect for your situation?

The fact that the proxy encodes the URLs it finds within manifests is intended to redirect those URLs through the proxy, which (in your example) is listening at port 8080. To remove this port would make the URLs default to port 80.. which wouldn't reach the proxy; you may have another httpd listening on 80, but it wouldn't understand the base64 encoded URL path.

@alekorhonen
Copy link
Author

Yes, I am running the proxy at http://proxy.mydomain.com:8080. I have a reverse proxy setup for the subdomain through nginx that points to that port (8080) so that I can setup authentication layer on top of the hls proxy, if that makes sense.

Now the master manifest loads fine when I request it, but all the urls contained in the master manifest include the port in the url, which is what I do not want in there because the url's are invalid in my case and will not point anywhere.

Let's say we load the master manifest at first
http://proxy.mydomain.com/<BASE64>.m3u8

After loading the master manifest, all the url's in there point to http://proxy.mydomain.com:8080/ instead of http://proxy.mydomain.com/.

@warren-bank
Copy link
Owner

warren-bank commented Dec 16, 2021

now, my understanding is that..

the public facing server is located at:

  • host = proxy.mydomain.com
  • port = 80

and you've configured this server (after proper authentication) to reverse proxy (conceptually similar to a URL redirect) all requests for all paths to:

  • host = <IP for instance of HLS-Proxy, reachable by reverse proxy>
  • port = 8080
  • note = IP:8080 is behind a firewall and cannot be accessed directly by the general public, only through the reverse proxy

This code is relevant to your situation. The code comments speak to your exact situation, which probably never bubbled up to become visible in the README. The solution is that when you start the proxy server on the command-line, you embed the public facing port number in the host option. For example, --host "proxy.mydomain.com:80" --port 8080

Please give this a try, and let me know if it solves your situation. Thanks.

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

2 participants