Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server Timeout #391

Closed
yjcxy12 opened this issue Jan 29, 2016 · 10 comments
Closed

Server Timeout #391

yjcxy12 opened this issue Jan 29, 2016 · 10 comments

Comments

@yjcxy12
Copy link

yjcxy12 commented Jan 29, 2016

I was working with video and serve the file from local file system. If the video length is more than 2 minutes, the server gives net::ERR_CONTENT_LENGTH_MISMATCH error.

It was due to express server default timeout is 2 minutes. My temporary solution was to change manually to Server.js -> listeningApp to set timeout to 0.

Is there a better way to solve the problem? If not, is there going to be a configurable option for server timeout in the future?

Thanks

@sokra
Copy link
Member

sokra commented Mar 25, 2016

a PR for ranges was merged

@sokra sokra closed this as completed Mar 25, 2016
@revathskumar
Copy link

@sokra Is this settings available on webpack 1.x?

@ShadowManu
Copy link

@sokra any reference to the PR? angular/angular-cli seems to have an error about this and I'm searching for information about it.

@pjivers
Copy link

pjivers commented Oct 10, 2017

@sokra Any reference to the PR?

@mohankumarv2005
Copy link

@yjcxy12, it worked perfectly, thanks!

node_modules\webpack-dev-server\lib\Server.js

this.listeningApp.timeout = 600000; //10 Minutes

@asfernandes
Copy link

I'm still having a timeout with a reconnect after 2 minutes with webpack-dev-server 2.11.1.

@catchin
Copy link

catchin commented Mar 28, 2018

I also had the problem of 2 minutes timeout for a proxy request and I could solve the problem with the following webpack-dev-server configuration for http-proxy:

proxy: {
  '/api': {
    target: 'http://localhost:8080',
    proxyTimeout: 5 * 60 * 1000,
    onProxyReq: (proxyReq, req, res) => req.setTimeout(5 * 60 * 1000)
  }
}

See webpack-dev-server, http-proxy and node http api documentations.

@fuadmuhtaz
Copy link

If you want no timeout you can set 0 to proxyTimeout and onProxyReq.

@prodrammer
Copy link

I've tried all of these suggestions, no dice. The browser disconnects after 2 minutes. Any other suggestions?

@abhishekkovuri
Copy link

As I use axios for making api calls. so eventually i was trying to set timeout there.
I was also in a assumption that setting a time out there would work but it was not working tried number of ways.
Finally i have created a html and tried axios there then i realised that i need to make changes in my webpack.
adding proxyTimeout would solve the issue
proxy: {
'/api/**': {
target: 'http//localhost:8888/',
proxyTimeout: 10 * 60 * 1000,
onProxyReq: (proxyReq, req, res) => req.setTimeout(10 * 60 * 1000),
changeOrigin: true
}
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests