Implement session endpoint to proxy build services requests
As a part of https://gitlab.com/gitlab-org/gitlab-ee/issues/5276 we need to implement extend the build session and add a new endpoint that will be able to proxy requests coming from Rails-Workhorse to a specific service running in the build.
The endpoint will be something like /session/uuid/proxy/<build|or|service-name>/<port>/<requested-uri>
.
This proxy mechanism should be able to be bi-directional. In this situation, we would need to handle websocket connections automatically. If the request is not a websocket one the proxy would act as an unidirectional reverse proxy.
Edited by Francisco Javier López (ex-Gitlab)