How can I let webpack-dev-server have incoming request timeout with custom value?

Viewed 4759

I have a webpack config file with webpack-dev-server as below.

const webpack = require('webpack');

module.exports = {
    devtool: 'inline-source-map',
    devServer: {
    disableHostCheck: true,
    historyApiFallback: true,
    compress: true,
    host: '0.0.0.0',
    port: 3000,
    publicPath: '/static/js/',
    proxy: {
        '**': {
            target: 'http://localhost.idincu.net:8080',
            secure: false,
            prependPath: false,
            proxyTimeout: 1000 * 60 * 10
            }
        }
    },
    plugins: [
        new webpack.NamedModulesPlugin()
    ]
}

Now, I'm getting ECONNRESET when I sent a request to the backend server with proxy. The reason why this happened is probably setting timeout of webpack-dev-server.

And I have dug into this in order to change timeout setting of webpack-dev-server. But I have failed. Can anyone give some advice for me?

One of some ways what I have found to do it is to set timeout on express. Or if there were a way to use devServer.before property corresponding to my config file, it would be a good way for me.

Thank you in advance.

1 Answers
Related