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

Web UI trying to connect to 127.0.0.1 #46

Open
sshaikh opened this issue Jun 18, 2020 · 9 comments
Open

Web UI trying to connect to 127.0.0.1 #46

sshaikh opened this issue Jun 18, 2020 · 9 comments

Comments

@sshaikh
Copy link

sshaikh commented Jun 18, 2020

On the server I run docker run -p 80:80 -p 8080:8080 roverr/rtsp-stream:2-management.

I get the UI but the add button does nothing. On inspection it seems that it's trying to reach 127.0.0.1

@MACscr
Copy link

MACscr commented Jun 29, 2020

I am having the same issue. Not sure how to solve it.

@ofadam
Copy link

ofadam commented Jul 3, 2020

Same issue as well.

This appears to be the same issue as here: #36

@Roverr
Copy link
Owner

Roverr commented Jul 20, 2020

Hi everyone,

Thanks for opening this issue!

The solution for this is to implement the building of the frontend when the docker image starts.

What does it mean?
It means that whenever the docker image starts it builds the UI from scratch using the environment variables given to it. So ideally, when starting the image you would pass an RTSP_STREAM_BACKEND_URL variable which would tell the frontend what is the exact address of the backend.

Why does it work locally?
Because on localhost of course you can access your system using this 127.0.0.1

How to achieve this?
I need to make changes in how the image works. This would result in a bigger image, but I don't think it matters too much. However it is uncomfortable, as the current management image does not have Node in dependency.

When?
Not sure at the moment. I have an ongoing project that eats up most of my time which ends in August. Hopefully I will be able to get back to this topic by then. However until that, feel free to create a PR please.

@quaint-engineer
Copy link

quaint-engineer commented Jul 27, 2020

For a quick solution, I consoled into the container and ran
find /ui -type f -exec sed -i 's/localhost:8080/<YOUR DOCKER MACHINE IP>:8080/g' {} \;
find /ui -type f -exec sed -i 's/127.0.0.1:8080/<YOUR DOCKER MACHINE IP>:8080/g' {} \;.
Then reboot the container. You may also need to clear your browser history after this change.

@sshaikh
Copy link
Author

sshaikh commented Jul 28, 2020

This was helpful! For those unfamiliar with docker, I used the following (sudos omitted):

docker ps #to find the name
docker exec -it <container-name> bash
find /ui -type f -exec sed -i 's/localhost:8080/10.10.0.6:8080/g' {} \;
find /ui -type f -exec sed -i 's/127.0.0.1:8080/10.10.0.6:8080/g' {} \;
exit
docker restart <container-name>

I haven't figured out how to persist this, but it's enough to test rtsp-stream - which works fabulously by the way.

@hillbun
Copy link

hillbun commented Aug 18, 2020

@Roverr

what is RTSP_STREAM_BACKEND_URL variable format?

is it http://10.10.0.6:8080/ ?

@chunfeng-zhang
Copy link

Hi everyone,

Thanks for opening this issue!

The solution for this is to implement the building of the frontend when the docker image starts.

What does it mean?
It means that whenever the docker image starts it builds the UI from scratch using the environment variables given to it. So ideally, when starting the image you would pass an RTSP_STREAM_BACKEND_URL variable which would tell the frontend what is the exact address of the backend.

Why does it work locally?
Because on localhost of course you can access your system using this 127.0.0.1

How to achieve this?
I need to make changes in how the image works. This would result in a bigger image, but I don't think it matters too much. However it is uncomfortable, as the current management image does not have Node in dependency.

When?
Not sure at the moment. I have an ongoing project that eats up most of my time which ends in August. Hopefully I will be able to get back to this topic by then. However until that, feel free to create a PR please.

You may use JS API window.location.href to get the host.

@mmm8955405
Copy link

https post, How do I find it?

@mmm8955405
Copy link

There are also cross domain requirements

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

8 participants