MoffKalast / vizanti

A mission planner and visualizer for controlling outdoor ROS robots.
https://wiki.ros.org/vizanti
BSD 3-Clause "New" or "Revised" License
133 stars 26 forks source link

Working behind proxy #50

Closed giovanidiniz closed 8 months ago

giovanidiniz commented 8 months ago

Hi, guys,

I've been exploring vizanti as a consolidated web interface for my aerial and ground platforms.

I've been having trouble running SITL instances behind a proxy on my cloud server using the ros2-feature branch. The best I could get so far is a screen with background colors, but nothing else. It looks like I can reach the base html but none of the js stuff is reachable, maybe?

So far, I've tried to use all sorts of values for base_url to try and fix this with no success. I'm wondering if I there might a need to set the js files paths (although I thought that's what url_for did).

Any ideas would be super welcome, I'm at a loss now

Thanks!

MoffKalast commented 8 months ago

Hmm well that's peculiar for sure, if you're not seeing any icons in the top bar after loading then either JS is either not being served or is being blocked by the browser. What kind of console/network errors do you get client side, if any?

If your proxy is only set up for specific ports, then you might wanna check if 5000 (static serve) and 5001 (rosbridge) are being forwarded. I suppose you could try a Wireshark capture when accessing it from the same machine and then again through the proxy to see what's not getting through.

giovanidiniz commented 8 months ago

Ah, I'm getting a bunch of these:

my.domain.com/:1 Refused to execute script from 'https://my.domain.com/js/setup.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

I think you're right, I'm missing the actual proxied route between my.domain.com and the /js stuff.

MoffKalast commented 8 months ago

That does actually ring a bell, the mime type is being set explicitly for template files, otherwise the scripts can't be imported. It's interesting that it's failing on the statically declared ones. Maybe your proxy is somehow changing mime types in transit? The declaration of those is here btw, if you want to try changing it and seeing if anything helps.

giovanidiniz commented 8 months ago

Ah, I managed to get this working. I had a typo on my proxy route.

I appreciate the help! things are working fine and looking good!

Thanks for making the package available!