Skip to content

Commit

Permalink
Merge pull request #30 from kubevirt-bot/cherry-pick-28-to-release-v0.3
Browse files Browse the repository at this point in the history
[release-v0.3] fix: example-client: Token in subprotocol needs to be in base64
  • Loading branch information
kubevirt-bot authored Aug 29, 2023
2 parents e160686 + 97045c5 commit 2b36fcb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 2 additions & 4 deletions example-client/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Example VNC client

**This example client currently does not work. It will be fixed in the future.**

This directory contains an example page that uses noVNC library
to connect to the `vn-console-proxy` running on a cluster.
to connect to the `VMI/vnc` endpoint using a token.

A simple server with this page can be started by:
```bash
Expand All @@ -15,7 +13,7 @@ The client page takes these URL parameters:
- `port` - Port for kubevirt API. For CRC it will be `6443`.
- `namspace` - Namespace where the VM is.
- `name` - Name of the VM.
- `token` - Token generated using the `/token` endpoint.
- `token` - Token returned by `vm-console-proxy`.

For example, the following URL will point the client to a VM after substituting variables:
```
Expand Down
3 changes: 2 additions & 1 deletion example-client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@
url,
{
wsProtocols: [
"base64url.bearer.authorization.k8s.io." + vncToken,
// The token needs to be base64 encoded
"base64url.bearer.authorization.k8s.io." + btoa(vncToken),
"base64.binary.k8s.io"
]
}
Expand Down

0 comments on commit 2b36fcb

Please sign in to comment.