3

We are using webpack-dev-server with http-proxy-middleware. Our Protractor test cases keep timing out. I suspect we need to have keep-alive set to true, but I don't see such an option either in webpack-dev-server nor in http-proxy-middleware. Is it possible to configure keep-alive for wepack-dev-server?

Thanks

Anna T
  • 101
  • 1
  • 6

2 Answers2

3

Yes, You can configure keep-alive in headers options like below. Use devServer.proxy.headers option.

devServer: {
    publicPath: '...',
    contentBase: '...',
    port: 9090,
    proxy: {
        '/**': {
            target: 'http://localhost:8080/',
            secure: false,
            changeOrigin: true,
            headers: {
                Connection: 'keep-alive'
            }
        }
    },
    open: true,
    inline: true,
    hot: false
}
Younghun Jung
  • 329
  • 5
  • 17
2

use Connection: 'Keep-alive', Make sure the first letter 'C' captialized, not the connection: 'keep-alive' whick ruined my whole day.

xdu
  • 46
  • 2