-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproxy.config.js
32 lines (31 loc) · 1.15 KB
/
proxy.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
let cookie = [];
module.exports = {
'/api/*': {
target: "http://dev.hamdamapi.ir",
secure: true,
logLevel: "debug",
changeOrigin: true,
withCredentials: true,
cookieDomainRewrite:{
"https://dev.accounts.idall.pro":"localhost"
},
// onProxyReq: (proxyReq, req) => {
// if (cookie.length > 0) {
// // let joined = cookie.join('; ');
// proxyReq.setHeader('Cookie', cookie);
// }
// },
// onProxyRes: (proxyRes) => {
// Object.keys(proxyRes.headers).forEach((key) => {
// if (key === 'set-cookie') {
// cookie = proxyRes.headers[key][0].split('; ')[0];
// // proxyRes.setHeader('foo', 'bar');
// //const cookieValue = proxyRes.headers[key];
// // cookie.push(cookieValue);
// //const cookieTokens = split(proxyRes.headers[key], ',');
// //cookie = cookieTokens.filter(element => element.includes('idall.auth')).join(';');
// }
// })
// }
}
};