update
This commit is contained in:
@@ -2,7 +2,7 @@ import { getDNS, isIpv4OrIpv6, isLocalhost } from '../modules/fm-manager/index.t
|
||||
import http from 'node:http';
|
||||
import https from 'node:https';
|
||||
import { UserApp } from '../modules/user-app/index.ts';
|
||||
import { config, fileStore } from '../modules/config.ts';
|
||||
import { myConfig as config, fileStore } from '../modules/config.ts';
|
||||
import path from 'node:path';
|
||||
import fs from 'node:fs';
|
||||
import { getContentType } from '../modules/fm-manager/index.ts';
|
||||
@@ -78,8 +78,8 @@ export const handleRequest = async (req: http.IncomingMessage, res: http.ServerR
|
||||
// 提取req的headers中的非HOST的header
|
||||
const headers = Object.keys(req.headers).filter((item) => item && item.toLowerCase() !== 'host');
|
||||
const host = req.headers['host'];
|
||||
logger.info('proxy host', host);
|
||||
logger.info('headers', headers);
|
||||
logger.debug('proxy host', host);
|
||||
logger.debug('headers', headers);
|
||||
|
||||
headers.forEach((item) => {
|
||||
header[item] = req.headers[item];
|
||||
@@ -96,7 +96,7 @@ export const handleRequest = async (req: http.IncomingMessage, res: http.ServerR
|
||||
// @ts-ignore
|
||||
options.port = _u.port;
|
||||
}
|
||||
logger.info('proxy options', options);
|
||||
logger.debug('proxy options', options);
|
||||
const isHttps = _u.protocol === 'https:';
|
||||
const protocol = isHttps ? https : http;
|
||||
if (isHttps) {
|
||||
|
||||
Reference in New Issue
Block a user