We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http-proxy-middleware
const proxyMiddleware = createProxyMiddleware({ target: 'https://xxx.aaa.com', ws:true, secure: false, changeOrigin: true, selfHandleResponse : true, on: { proxyReq: (proxyReq, req, res) => {
// 抓包显示User-Agent未被改变 proxyReq.setHeader('User-Agent', 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148'); // 抓包显示User-Agent未被改变 req.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148'; console.log('[DEMO] Request header:' + req.rawHeaders); if (req.method == 'POST') { console.log('[DEMO] Request body:' + req.body); } }, proxyRes: responseInterceptor(async (responseBuffer, proxyRes, req, res) => { const response = responseBuffer.toString('utf8'); console.log('[DEMO] Response body:' + response); return responseBuffer; }), error: (err, req, res) => { console.log('[DEMO] Error:' + err.message); },
}, logger: console, });
如代码所示,代理出口抓包显示User-Agent未被改变 Mac 通过npn安装的最新版
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Checks
http-proxy-middleware
.Describe the bug (be clear and concise)
const proxyMiddleware = createProxyMiddleware({
target: 'https://xxx.aaa.com',
ws:true,
secure: false,
changeOrigin: true,
selfHandleResponse : true,
on: {
proxyReq: (proxyReq, req, res) => {
},
logger: console,
});
如代码所示,代理出口抓包显示User-Agent未被改变
Mac 通过npn安装的最新版
The text was updated successfully, but these errors were encountered: