Skip to content

proxy server does not work #2126

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

Closed
1 of 2 tasks
SephVelut opened this issue Jul 16, 2019 · 5 comments
Closed
1 of 2 tasks

proxy server does not work #2126

SephVelut opened this issue Jul 16, 2019 · 5 comments

Comments

@SephVelut
Copy link

SephVelut commented Jul 16, 2019

  • Operating System: OSX
  • Node Version: v12.6.0
  • NPM Version: 6.9.0
  • webpack Version: 4.28.4
  • webpack-dev-server Version: 3.7.2
  • Browser: chrome Version 75.0.3770.100
  • This is a bug
  • This is a modification request

Given

module.exports = {
  devServer: {
    proxy: {
      '/login': {
        target: 'http://localhost:8000',
        changeOrigin: true,
        logLevel: 'debug'
      }
    }
  }
}

The dev server successfully proxies the request to localhost:8000 backend server. I see the request reaches the backend server and the backend server responds with

HTTP/1.1 202 Accepted
Content-Length: 0
Date: Tue, 16 Jul 2019 02:55:17 GMT
Server: MyServer

Despite that, the webpack dev server errors out with Proxy error: Could not proxy request /login from localhost:8080 to http://localhost:8000. See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNRESET).

The Ajax request on the javascript side receives a 500 http error.

@alexander-akait
Copy link
Member

You don't provide minimum reproducible test repo as described in issue template so we can't help, you can see ECONNRESET error - what mean you server reset connection, or something other on this host:port reset connection. Without reproducible test repo we can't help

@SephVelut
Copy link
Author

SephVelut commented Jul 17, 2019

Here is a minimal reproducible test repo
Here is a webm of the issue as I'm executing it

@SephVelut
Copy link
Author

So it appears that the proxy dev server expects the tcp connection to remain connected after the backend server sends its response. Am I supposed to just hold the connection resource open, for every single new connection from the proxy server, permanently on my server? I would not like to do this. Is this expected? Is this configurable?

@hiroppy
Copy link
Member

hiroppy commented Jul 29, 2019

@SephVelut Can you explain how to occur this problem using your repository? I would like to know the procedure because your minimal test repository doesn't have README.

@SephVelut
Copy link
Author

@hiroppy I agree, the repo should include an example server that the proxy uses to talk to as it's an important piece. Right now I don't have time so I'm going to close this issue, until I can address it again in the future.

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

3 participants