mirror of
https://git.tuxpa.in/a/code-server.git
synced 2024-12-26 12:15:26 +00:00
Catch proxy errors
Otherwise they'll crash code-server.
This commit is contained in:
parent
c0dd29c591
commit
737a8f5965
@ -1,3 +1,4 @@
|
||||
import { logger } from "@coder/logger"
|
||||
import * as http from "http"
|
||||
import proxy from "http-proxy"
|
||||
import * as net from "net"
|
||||
@ -21,6 +22,7 @@ export class ProxyHttpProvider extends HttpProvider implements HttpProxyProvider
|
||||
public constructor(options: HttpProviderOptions, proxyDomains: string[] = []) {
|
||||
super(options)
|
||||
this.proxyDomains = proxyDomains.map((d) => d.replace(/^\*\./, "")).filter((d, i, arr) => arr.indexOf(d) === i)
|
||||
this.proxy.on("error", (error) => logger.warn(error.message))
|
||||
}
|
||||
|
||||
public async handleRequest(
|
||||
|
Loading…
Reference in New Issue
Block a user