rtsp-stream
rtsp-stream copied to clipboard
Web UI trying to connect to 127.0.0.1
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
I am having the same issue. Not sure how to solve it.
Same issue as well.
This appears to be the same issue as here: https://github.com/Roverr/rtsp-stream/issues/36
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.
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.
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.
@Roverr
what is RTSP_STREAM_BACKEND_URL variable format?
is it http://10.10.0.6:8080/ ?
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.
https post, How do I find it?
There are also cross domain requirements