add port config
This commit is contained in:
		@@ -76,13 +76,19 @@ export const handleRequest = async (req: http.IncomingMessage, res: http.ServerR
 | 
			
		||||
  if (_api === 'api') {
 | 
			
		||||
    // 代理到 http://codeflow.xiongxiao.me/api
 | 
			
		||||
    // 设置代理请求的目标 URL 和请求头
 | 
			
		||||
    let header: any = {};
 | 
			
		||||
    if (req.headers?.['Authroization']) {
 | 
			
		||||
      header.Authorization = req.headers?.['Authroization'];
 | 
			
		||||
    }
 | 
			
		||||
    if (req.headers?.['Content-Type']) {
 | 
			
		||||
      header['Content-Type'] = req.headers?.['Content-Type'];
 | 
			
		||||
    }
 | 
			
		||||
    const options = {
 | 
			
		||||
      host: api.host,
 | 
			
		||||
      path: req.url,
 | 
			
		||||
      method: 'POST',
 | 
			
		||||
      headers: {
 | 
			
		||||
        'Content-Type': req.headers['content-type'],
 | 
			
		||||
        Authroization: req.headers?.['authorization'] || '',
 | 
			
		||||
        ...header,
 | 
			
		||||
      },
 | 
			
		||||
    };
 | 
			
		||||
    // 创建代理请求
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user