-
Notifications
You must be signed in to change notification settings - Fork 23
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
Allow ws access when remotely accessing openrvdas webUI via port forwarding #337
Comments
This looks reasonable, but I can't figure out which file this is in - not
django_gui/settings.py?
…On Thu, Jul 20, 2023 at 2:46 PM Webb Pinner ***@***.***> wrote:
Several vessels provide remote access to the OpenRVDAS via ssh-based port
forwarding. This works for the static portions of the OpenRVDAS webUI but
because the port used for the ws connection is explicitly defined to a port
number within the settings.py file the ws socket traffic is not accessible
when accessing via ssh port-forwarding.
Running on the assumption that the WS port is the same as the port used by
nginx during install would it be possible to define the ws port as the same
port specified in the URL.
TL;DR
Can the default vault of WEBSOCKET_SERVER be changed from:
var WEBSOCKET_SERVER = "ws://:80/cds-ws";
To:
var WEBSOCKET_SERVER = (document.location.protocol === 'https:' ? 'wss' : 'ws' ) + '//:' + document.location.port + "/cds-ws";
—
Reply to this email directly, view it on GitHub
<#337>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFO7V3TE2EMV4V7OI3ELBF3XRESDVANCNFSM6AAAAAA2RL7N6Q>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
It's in: |
Got it. I'm not sure the text replacement you suggest would work, as even
though it ends up being used in JS code, it's handed to the JS code via
python, and first interpreted as a string in Python (in settings.py). And I
don't think Python would know what to do with document.location.port.
…On Thu, Jul 20, 2023 at 5:07 PM Webb Pinner ***@***.***> wrote:
It's in:
https://github.com/OceanDataTools/openrvdas/blob/master/django_gui/templates/django_gui/index.html
but that file just refers back to what's set in settings.py
—
Reply to this email directly, view it on GitHub
<#337 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFO7V3SJBCAFTO2ATKAOSLDXRFCUNANCNFSM6AAAAAA2RL7N6Q>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I was curious about that. My initial thought was that the string would be not be interpreted until it was in the browser which I assumed would be fine as just a JS string passed to the template via the Django code. I might be wrong in that assumption. |
We've solved that one. var WEBSOCKET_PORT = window.location.port || 443; That file may or may not have been generated by something further upstream (I'd have to run through the installation script and whatnot to give you a definitive answer), but .... Standard disclaimer: It works for me !! |
Ah, I think you can get away with this because the display widget port is
defined in JS code, but what Webb wants to change is specified in
django_gui/settings.py[.dist]. And Python can't handle the js variable.
I think the way to get this done would be to tweak the (static) js to
include a separate js config that's stashed somewhere canonical.
…On Thu, Mar 28, 2024 at 10:06 AM LMG-ET ***@***.***> wrote:
We've solved that one.
We tweaked ${OPENRVDASROOT}/display/js/widgets/settings.js
var WEBSOCKET_PORT = window.location.port || 443;
That file may or may not have been generated by something further upstream
(I'd have to run through the installation script and whatnot to give you a
definitive answer), but ....
Standard disclaimer: It works for me !!
—
Reply to this email directly, view it on GitHub
<#337 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFO7V3UNYR6HAZHR3QZADBLY2REZRAVCNFSM6AAAAAA2RL7N6SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRVG4YDQNBRG4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Several vessels provide remote access to the OpenRVDAS via ssh-based port forwarding. This works for the static portions of the OpenRVDAS webUI but because the port used for the ws connection is explicitly defined to a port number within the settings.py file the ws socket traffic is not accessible when accessing via ssh port-forwarding.
Running on the assumption that the WS port is the same as the port used by nginx during install would it be possible to define the ws port as the same port specified in the URL.
TL;DR
Can the default vault of
WEBSOCKET_SERVER
be changed from:To:
The text was updated successfully, but these errors were encountered: