mirror of https://git.tuxpa.in/a/code-server.git
parent
c0dd29c591
commit
737a8f5965
|
@ -1,3 +1,4 @@
|
||||||
|
import { logger } from "@coder/logger"
|
||||||
import * as http from "http"
|
import * as http from "http"
|
||||||
import proxy from "http-proxy"
|
import proxy from "http-proxy"
|
||||||
import * as net from "net"
|
import * as net from "net"
|
||||||
|
@ -21,6 +22,7 @@ export class ProxyHttpProvider extends HttpProvider implements HttpProxyProvider
|
||||||
public constructor(options: HttpProviderOptions, proxyDomains: string[] = []) {
|
public constructor(options: HttpProviderOptions, proxyDomains: string[] = []) {
|
||||||
super(options)
|
super(options)
|
||||||
this.proxyDomains = proxyDomains.map((d) => d.replace(/^\*\./, "")).filter((d, i, arr) => arr.indexOf(d) === i)
|
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(
|
public async handleRequest(
|
||||||
|
|
Loading…
Reference in New Issue