Commit 2eb8d8fd authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Proxy ActionCable websocket connection

Had to use a simple proxy because the other ResponseWriter
wrappers do not support HiJack and we don't need those for
this route anyway
parent c961c60b
......@@ -162,6 +162,7 @@ func (u *upstream) configureRoutes() {
static := &staticpages.Static{DocumentRoot: u.DocumentRoot}
proxy := buildProxy(u.Backend, u.Version, u.RoundTripper)
simpleProxy := proxypkg.NewProxy(u.Backend, u.Version, u.RoundTripper)
signingTripper := secret.NewRoundTripper(u.RoundTripper, u.Version)
signingProxy := buildProxy(u.Backend, u.Version, signingTripper)
......@@ -191,6 +192,9 @@ func (u *upstream) configureRoutes() {
route("POST", apiPattern+`v4/jobs/[0-9]+/artifacts\z`, contentEncodingHandler(artifacts.UploadArtifacts(api, signingProxy))),
route("POST", ciAPIPattern+`v1/builds/[0-9]+/artifacts\z`, contentEncodingHandler(artifacts.UploadArtifacts(api, signingProxy))),
// ActionCable websocket
wsRoute(`^/-/cable\z`, simpleProxy),
// Terminal websocket
wsRoute(projectPattern+`-/environments/[0-9]+/terminal.ws\z`, channel.Handler(api)),
wsRoute(projectPattern+`-/jobs/[0-9]+/terminal.ws\z`, channel.Handler(api)),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment