Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 330e75a

Browse files
Catch proxy errors
Otherwise they'll crash code-server.
1 parent 2a276b4 commit 330e75a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎src/node/app/proxy.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { logger } from "@coder/logger"
12
import * as http from "http"
23
import proxy from "http-proxy"
34
import * as net from "net"
@@ -21,6 +22,7 @@ export class ProxyHttpProvider extends HttpProvider implements HttpProxyProvider
2122
public constructor(options: HttpProviderOptions, proxyDomains: string[] = []) {
2223
super(options)
2324
this.proxyDomains = proxyDomains.map((d) => d.replace(/^\*\./, "")).filter((d, i, arr) => arr.indexOf(d) === i)
25+
this.proxy.on("error", (error) => logger.warn(error.message))
2426
}
2527

2628
public async handleRequest(

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /