转发的请求修改ua

This commit is contained in:
黄心宇 2024-01-15 15:44:15 +08:00
parent 54cf201a51
commit 85cdce8e19
1 changed files with 4 additions and 1 deletions

View File

@ -11,7 +11,10 @@ const targetServer = url; // Java 服务器的地址
const options = {
target: targetServer,
changeOrigin: true, // 允许在请求头中更改主机
timeout: 30000
timeout: 30000,
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0'
}
};
// 设置代理