NoVNC: how to specify cookie for WebSocket URL

1.2k Views Asked by At

I want to pass a WebSocket RFB URL to NoVNC library. But this needs an authentication cookie to be provided via headers. How can I tell NoVNC to use cookies during request?

1

There are 1 best solutions below

0
On BEST ANSWER

If you are wanting to change the WebSocket path that noVNC uses you can do it via the settings or use the "path" query parameter. Here is where the setting is located in the noVNC UI:

enter image description here

If you are interested in noVNC Token-based target selection then you can set the "token" query param for the WebSocket path (not the noVNC URL). In other words, a noVNC URL with a websockify token specified would look something like this:

http://host1:6080?host=host1&port=6080&path=websockify?token=foo