Commit b6aaa6f
committed
Detect VNC-in-use error state
noVNC provides no direct access the error code returned by
socket.on("close") callback. As a workaround the original callback is
replaced by a custom proxy.
The backend returns the message introduced in #15267 for HTTP requests.
For the websocket requests we receive error 1006 (abnormal disconnect).
As a workaround an additional dedicated HTTP request is triggered to
retrieve the error.
Reference-Url: kubevirt/kubevirt#15267
Reference-Url: https://github.com/kubevirt/kubevirt/blob/46aa1b24982cd6fcfd37c950825c8d3acd3dbaf3/pkg/virt-handler/rest/console.go#L163
Reference-Url: https://github.com/novnc/noVNC/blob/d44f7e04fc456844836c7c5ac911d0f4e8dd06e6/core/rfb.js#L662
Reference-Url: https://datatracker.ietf.org/doc/html/rfc6455#section-7.4
Signed-off-by: Radoslaw Szwajkowski <[email protected]>1 parent 12402ee commit b6aaa6f
File tree
3 files changed
+66
-9
lines changed- src/utils/components/Consoles/components
- utils
- vnc-console
- utils
3 files changed
+66
-9
lines changedLines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
Lines changed: 59 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
41 | 57 | | |
42 | 58 | | |
43 | 59 | | |
| |||
76 | 92 | | |
77 | 93 | | |
78 | 94 | | |
| 95 | + | |
79 | 96 | | |
80 | 97 | | |
81 | 98 | | |
82 | 99 | | |
83 | 100 | | |
84 | 101 | | |
85 | | - | |
86 | | - | |
87 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
88 | 109 | | |
89 | 110 | | |
90 | 111 | | |
91 | 112 | | |
92 | 113 | | |
93 | | - | |
| 114 | + | |
94 | 115 | | |
95 | | - | |
96 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
97 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
98 | 149 | | |
| 150 | + | |
99 | 151 | | |
100 | 152 | | |
101 | 153 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
0 commit comments