Commit Graph

10 Commits

Author SHA1 Message Date
Anmol Sethi f5cf3fd331
proxy.ts: Do not always rewrite redirects against the base path
This breaks --proxy-path-passthrough

However, we still need this when that code is disabled as many apps will
issue absolute redirects and expect the proxy to rewrite as appropriate.

e.g. Go's http.Redirect will rewrite relative redirects as absolute!
See https://golang.org/pkg/net/http/#Redirect
2021-02-01 11:08:40 -05:00
Asher f7076247f9
Move domain proxy to routes
This matches better with the other routes.

Also add a missing authentication check to the path proxy web socket.
2020-11-05 17:07:32 -06:00
Asher f6c4434191
Tweak proxy fallthrough behavior
It will now redirect all HTML requests. Also it avoids req.accepts since
that's always truthy.
2020-11-05 16:49:30 -06:00
Asher 7b2752a62c
Move websocket routes into a separate app
This is mostly so we don't have to do any wacky patching but it also
makes it so we don't have to keep checking if the request is a web
socket request every time we add middleware.
2020-11-05 15:08:09 -06:00
Asher 34225e2bdf
Use ensureAuthenticated as middleware 2020-11-04 17:07:40 -06:00
Asher e2c35facdb
Remove invalid comment on maybeProxy
It no longer handles authentication.
2020-11-04 17:07:35 -06:00
Asher 1067507c41
Proxy to 0.0.0.0 instead of localhost 2020-11-03 14:28:48 -06:00
Asher 305348f0ac
Improve proxy fallthrough logic
- Use accept header.
- Match /login and /login/ exactly.
- Match /static/ (trailing slash).
- Use req.path. Same result but feels more accurate to me.
2020-10-27 17:31:37 -05:00
Asher 257d9a4fa4
Make authentication work with sub-domain proxy 2020-10-26 17:56:14 -05:00
Asher 112eda4605
Convert routes to Express 2020-10-26 17:56:13 -05:00