diff --git a/docs/index.adoc b/docs/index.adoc index de15152..7057628 100644 --- a/docs/index.adoc +++ b/docs/index.adoc @@ -24,6 +24,7 @@ Ggr is using two types of configuration files: include::users-file.adoc[leveloffset=+1] include::quota-files.adoc[leveloffset=+1] include::quota-reload.adoc[leveloffset=+1] +include::video.adoc[leveloffset=+1] include::how-it-works.adoc[leveloffset=+1] include::multiple-instances.adoc[leveloffset=+1] include::log-files.adoc[leveloffset=+1] diff --git a/docs/log-files.adoc b/docs/log-files.adoc index eb6fa1c..477e0e8 100644 --- a/docs/log-files.adoc +++ b/docs/log-files.adoc @@ -34,17 +34,26 @@ The following statuses are available: | Status | Description | BAD_JSON | User request does not contain valid Selenium data +| BAD_RESPONSE | Upstream server returned data using unknown JSON protocol | BROWSER_NOT_SET | Browser name is not present or empty string | CLIENT_DISCONNECTED | User disconnected and doing session attempts was interrupted +| INVALID_HOST_VNC_URL | Failed to parse VNC host URL specified in quota configuration +| INVALID_VNC_REQUEST_URL | VNC request URL do not contain enough information to determine upstream host +| INVALID_VIDEO_REQUEST_URL | Video request URL do not contain enough information to determine upstream host | INVALID_URL | Session ID does not contain information about host where it was created | PROXYING_TO_VNC | Starting to proxy VNC traffic +| PROXYING_VIDEO | Starting to proxy video from upstream host | ROUTE_NOT_FOUND | Trying to proxy session to unknown host. Usually means quota files inconsistency between multiple Ggr instances. | SESSION_ATTEMPTED | New user request for session arrived | SESSION_CREATED | A new session was created and returned to user | SESSION_DELETED | Existing session was deleted by user request | SESSION_FAILED | Session attempt on specified host failed | SESSION_NOT_CREATED | Attempts to create a new session on all hosts failed. An error was returned to user. +| SHUTTING_DOWN | Server is shutting down and waiting graceful shutdown timeout for currently proxied requests to finish +| UNKNOWN_VNC_HOST | Requested to proxy VNC to host not present in quota +| UNKNOWN_VIDEO_HOST | Requested to proxy video to host not present in quota | UNSUPPORTED_BROWSER | Requested browser name and version is not present in quota +| UNSUPPORTED_HOST_VNC_SCHEME | Invalid URL protocol specified for host in quota VNC configuration (should be vnc:// or ws://) | VNC_CLIENT_DISCONNECTED | Client disconnected from VNC API | VNC_ERROR | An error occurred when trying to proxy VNC traffic | VNC_SESSION_CLOSED | Client closed VNC session diff --git a/docs/video.adoc b/docs/video.adoc new file mode 100644 index 0000000..276728f --- /dev/null +++ b/docs/video.adoc @@ -0,0 +1,13 @@ +== Proxying Session Video + +Ggr gives you an ability to view Selenium session videos captured directly from browser screen. + +. Video files are expected to be stored on the hub hosts specified in quota files and accessible via the following URL: + + http://hub-host.example.com:4444/video/.mp4 + ++ +This API for example is supported by http://aerokube.com/selenoid/latest[Selenoid]. +. To download video file via Ggr just use the same request but with the session ID returned to test: + + http://ggr-host.example.com:4444/video/.mp4 diff --git a/proxy.go b/proxy.go index a0a4fcd..f42ee3f 100644 --- a/proxy.go +++ b/proxy.go @@ -569,6 +569,7 @@ func video(w http.ResponseWriter, r *http.Request) { r.URL.Scheme = "http" r.URL.Host = h.net() r.URL.Path = fmt.Sprintf("/video/%s.mp4", sessionId) + log.Printf("[PROXYING_VIDEO] [%s] [%s]\n", sessionId, r.URL) }}).ServeHTTP(w, r) } else { log.Printf("[UNKNOWN_VIDEO_HOST] [%s]\n", sum)