Skip to content

Commit

Permalink
feat: 이전 버전으로 테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
sjy2335 committed Nov 14, 2024
1 parent 8d5f1c9 commit 7ce5a09
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions backend/proxy-server/src/server/proxy-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ export class ProxyServer {
connections: Number(process.env.DEFAULT_CONNECTIONS),
pipelining: Number(process.env.DEFAULT_PIPELINING),
keepAliveTimeout: Number(process.env.DEFAULT_KEEP_ALIVE),
connect: {
rejectUnauthorized: false,
},
},
});
}
Expand Down Expand Up @@ -92,7 +89,7 @@ export class ProxyServer {
private async executeProxyRequest(request: FastifyRequest, reply: FastifyReply): Promise<void> {
const host = validateHost(request.headers[HOST_HEADER]);
const ip = await this.resolveDomain(host);
const targetUrl = buildTargetUrl(ip, request.url, 'https://'); // TODO: Protocol 별 arg 세팅
const targetUrl = buildTargetUrl(ip, request.url, 'http://'); // TODO: Protocol 별 arg 세팅

await this.sendProxyRequest(targetUrl, request, reply);
}
Expand All @@ -117,8 +114,6 @@ export class ProxyServer {
request: FastifyRequest,
reply: FastifyReply,
): Promise<void> {
const originalHost = request.headers[HOST_HEADER] as string;

await new Promise<void>((resolve, reject) => {
reply.from(targetUrl, {
onError: (reply, error) => {
Expand All @@ -130,11 +125,6 @@ export class ProxyServer {
),
);
},

rewriteRequestHeaders: (req, headers) => ({
...headers,
host: originalHost,
}),
});
});
}
Expand Down

0 comments on commit 7ce5a09

Please sign in to comment.