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

Adding an ffmpeg url parameter #301

Merged
merged 4 commits into from
Mar 6, 2024
Merged

Conversation

nathanpalmer
Copy link
Contributor

This adds a way to override the ffmpeg_url. Specifically helpful in proxy situations where the website domain and the ffmpeg domain aren't going to be the same. It should fallback to the same URL it is using today if you don't pass in the parameter though.

Allows me to do this:

python3 app.py --url karaoke.example.com --ffmpeg-url karaoke-stream.example.com

The issue comes down to this. I don't want people who are coming to my house for the karaoke party to have to connect to my wifi network in order to use that QR code. I'd like to reduce as much friction as possible. So I have my existing network proxying the main URL going to the backend. However, we can't use that main URL as the ffmpeg_url because the PORT doesn't proxy through my router. (yes, I can setup a port forward.. but I had this dynamically assigning ports when using nomad so this option works a bit better.)

@vicwomg
Copy link
Owner

vicwomg commented Dec 28, 2023

Good timing, we're discussing this in #293 which is an effort to dockerize everything. The same issue was encountered.

Can you explain a little more how you have things setup on your proxy?

@vicwomg
Copy link
Owner

vicwomg commented Dec 28, 2023

On second thought, can you try this branch and see if it suits your needs?

303-proxy_http_ffmpeg_streams

This will have pikaraoke do all the proxying to ffmpeg, so it will all run on one port.

@nathanpalmer
Copy link
Contributor Author

Can you explain a little more how you have things setup on your proxy?

Sure. My router (Arista) is forwarding port 80/443 to a service router (Fabio) that handles the HTTPS termination and routes traffic to the right IP and port that it's running on. Since by default it uses the same url for ffmpeg and just appends the port, that doesn't make it through my router.

However, the other branch.. if it's all working on the same port sounds like it should also solve this issue. So I can try it.

@vicwomg
Copy link
Owner

vicwomg commented Dec 29, 2023

Can you explain a little more how you have things setup on your proxy?

Sure. My router (Arista) is forwarding port 80/443 to a service router (Fabio) that handles the HTTPS termination and routes traffic to the right IP and port that it's running on. Since by default it uses the same url for ffmpeg and just appends the port, that doesn't make it through my router.

However, the other branch.. if it's all working on the same port sounds like it should also solve this issue. So I can try it.

Yes please try the other branch and let me know. I believe that would be a cleaner solution overall

@nathanpalmer
Copy link
Contributor Author

Yes please try the other branch and let me know. I believe that would be a cleaner solution overall

Sorry for the delay! We had a new years eve party and I didn't want to change anything right before that. But finally got a chance to try it out.

I opened up the other branch and it seems to work just fine as well. So either way that you want to go seems to be OK. I see the other branch is still open though. But either way will solve my problem.

I see there are some conflicts here, so if you want to go this direction I can resolve them. Otherwise, if you're going to merge the other branch in, we can close.

Copy link
Owner

@vicwomg vicwomg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to go ahead and merge this. I don't see the harm in having it in and it seems to help with some folks with complicated networking needs

@vicwomg vicwomg merged commit 0b2e89c into vicwomg:master Mar 6, 2024
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

Successfully merging this pull request may close these issues.

2 participants