1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 09:51:09 +03:00

Fix webpack-dev-server proxy to accommodate auth changes

This commit is contained in:
gconsidine 2018-03-12 15:19:01 -04:00 committed by Jake McDermott
parent 81c85913ac
commit e3d42d8e1b

View File

@ -55,26 +55,37 @@ const watch = {
host: '127.0.0.1', host: '127.0.0.1',
https: true, https: true,
port: 3000, port: 3000,
https: true,
clientLogLevel: 'none', clientLogLevel: 'none',
proxy: { proxy: [{
'/': { context: (pathname, req) => !(pathname === '/api/login/' && req.method === 'POST'),
target: TARGET, target: TARGET,
secure: false, secure: false,
ws: false, ws: false,
bypass: req => req.originalUrl.includes('hot-update.json') bypass: req => req.originalUrl.includes('hot-update.json')
}, },
'/websocket': { {
target: TARGET, context: '/api/login/',
secure: false, target: TARGET,
ws: true secure: false,
}, ws: false,
'/network_ui': { headers: {
target: TARGET, Host: `localhost:${TARGET_PORT}`,
secure: false, Origin: TARGET,
ws: true Referer: `${TARGET}/`
} }
} },
{
context: '/websocket',
target: TARGET,
secure: false,
ws: true
},
{
context: '/network_ui',
target: TARGET,
secure: false,
ws: true
}]
} }
}; };