Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #177 from vania-pooh/master
Browse files Browse the repository at this point in the history
Fixed issue with proxying to remote WebSocket
  • Loading branch information
vania-pooh authored Mar 16, 2018
2 parents 459f308 + 5a96b43 commit 8455ff7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/quota-files.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ Two notations are supported in `vnc` attribute:

. If the remote server also returns VNC traffic on a web socket (which is a case for http://aerokube.com/selenoid/latest/#_live_browser_screen[Selenoid]) - then you should specify a `ws://` URL without trailing `<session-id>` value:
+
ws://my-selenoid-host.example.com/vnc
ws://my-selenoid-host.example.com:4444/vnc
+
Having this URL Ggr will append session ID and proxy VNC traffic from:
+
ws://my-selenoid-host.example.com/vnc/<session-id>
ws://my-selenoid-host.example.com:4444/vnc/<session-id>

=== Working with External Selenium Services

Expand Down
2 changes: 1 addition & 1 deletion proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ func vnc(wsconn *websocket.Conn) {
port = vncInfo.Port
path = vncInfo.Path
}
sessionID := strings.Split(wsconn.Request().URL.Path, "/")[2]
sessionID := strings.Split(wsconn.Request().URL.Path, "/")[2][md5SumLength:]
switch scheme {
case vncScheme:
proxyVNC(id, wsconn, sessionID, host, port)
Expand Down
2 changes: 1 addition & 1 deletion proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func TestProxyScreenWebSocketsProtocol(t *testing.T) {

const testData = "ws-data"
mux := http.NewServeMux()
mux.Handle("/vnc/", websocket.Handler(func(wsconn *websocket.Conn) {
mux.Handle("/vnc/123", websocket.Handler(func(wsconn *websocket.Conn) {
wsconn.Write([]byte(testData))
}))

Expand Down

0 comments on commit 8455ff7

Please sign in to comment.