-
Notifications
You must be signed in to change notification settings - Fork 65
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
Proxy sometimes hangs when request is disrupted #25
Comments
I have not used this module in a while; it's pretty much a community-maintained project at this point. So you'll have to investigate this. Luckily the source is still pretty small so you shouldn't have too hard of a time with it. |
I've noticed the same behavior using v0.5.0 and as well on v.0.9.0. Unfortunately I haven't been able yet to figure out the cause; so far it seems to occur at random. |
@RobbinHabermehl what does the rest of your stack look like? Last week I tried to debug by putting a lot of request/response event hooks in the proxy, but nothing seemed very out of the ordinary when it would hang. I'm thinking it's actually a browsersync issue—are you using browsersync? |
@noahgrant; I'm not using |
+1 to this. I'm using a 60-second long-polling interval from the client code to connect-proxy, and then to the backend. When I'm in rapid development and reloading often, these requests seem to get 'stuck' in the queue. No further requests are proxied until the one that's stuck is returned. I have to kill and restart the proxy server |
@dshefchik what's your stack look like? |
proxy-middleware: 0.5.1, |
+1 |
I have also run into hanging issues with the proxy until restart - using Ionic Framework and livereload. It would consistently fail after 5 reloads - For my case what is happening is that after 5 tries the http_agent_maxsockets limit is kicking in and further attempts block. Have yet to be able to trackdown the root cause of why the http keep-alive sockets are not getting reused/blocking. As a quick workaround I turned off keep-alive connection-pooling and no longer have hang ups. var opts = url.parse(proxy.proxyUrl);
//opt out of the pooling
opts.agent = false;
app.use('/path/', proxy(opts)); |
thanks @mur-dog. I'm not sure setting opts = url.parse(proxy.proxyUrl);
opts.headers = {
connection: 'close'
}; made the response headers give a |
We have a single-page-app with several proxies as we migrate off of rails, and we've found that sometimes, when a request hasn't completed (whether it's a proxied request or not, i think) and we make a new request (either by refreshing the page or, say, clicking another part of the page and triggering a new request), the proxy hangs, and we have to restart our server. On a refresh, we see all locally served files, but requests to a proxied server hang without a response. We're running proxy-middleware within browsersync, all within gulp.
If you have any insights about why this might happen, I'm happy to take a look and give a crack at it, but I figured I should post an issue about it to get some feedback first.
Thanks!
The text was updated successfully, but these errors were encountered: