| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import * as http from "http" | ||
| import { HttpCode, HttpError } from "../../common/http" | ||
| import { HttpProvider, HttpResponse, Route, WsResponse } from "../http" | ||
|
|
||
| /** | ||
| * Proxy HTTP provider. | ||
| */ | ||
| export class ProxyHttpProvider extends HttpProvider { | ||
| public async handleRequest(route: Route, request: http.IncomingMessage): Promise<HttpResponse> { | ||
| if (!this.authenticated(request)) { | ||
| if (this.isRoot(route)) { | ||
| return { redirect: "/login", query: { to: route.fullPath } } | ||
| } | ||
| throw new HttpError("Unauthorized", HttpCode.Unauthorized) | ||
| } | ||
|
|
||
| // Ensure there is a trailing slash so relative paths work correctly. | ||
| if (this.isRoot(route) && !route.fullPath.endsWith("/")) { | ||
| return { | ||
| redirect: `${route.fullPath}/`, | ||
| } | ||
| } | ||
|
|
||
| const port = route.base.replace(/^\//, "") | ||
| return { | ||
| proxy: { | ||
| base: `${this.options.base}/${port}`, | ||
| port, | ||
| }, | ||
| } | ||
| } | ||
|
|
||
| public async handleWebSocket(route: Route, request: http.IncomingMessage): Promise<WsResponse> { | ||
| this.ensureAuthenticated(request) | ||
| const port = route.base.replace(/^\//, "") | ||
| return { | ||
| proxy: { | ||
| base: `${this.options.base}/${port}`, | ||
| port, | ||
| }, | ||
| } | ||
| } | ||
| } |
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityWhy do we have a SSH server?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityI believe this has something to do with the Chrome extension that was planned but I'm not 100% sure on the status of that. @kylecarbs @wbobeirne
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityYes, this was for the browser extension. That's pretty much on ice at this point, so I think it's probably best for safety / code cleanliness that we take it out since nothing is using it right now, and it's probably a liability to have such a powerful thing up by default. Or at the very least, disable by default.
Would be happy to make a PR to remove that if we're definitely not going to pursue the extension, but I'll defer to mr @kylecarbs on that.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.