chimurai / http-proxy-middleware

:zap: The one-liner node.js http-proxy middleware for connect, express, next.js and more
MIT License
10.68k stars 826 forks source link

Im unable to use Proxy with Google Cloud Functions #868

Closed Costiss closed 11 months ago

Costiss commented 1 year ago

Checks

Describe the bug (be clear and concise)

Iim triyng to use and express server as API Gateway, with Google Cloud Functions

Im running locally with @google-cloud/functions framework. On Cloud the behavior is the same https://cloud.google.com/functions/docs/running/function-frameworks?hl=pt-br

The request lasts forever. After timeout, I get this error on target server image

On Gateway server it justs timeout image

Step-by-step reproduction instructions

1. Create a express server with createProxyMiddleware
2. run with function-framework
3. try to make a request

Expected behavior (be clear and concise)

Excpected same behavior as runing withou serverless

How is http-proxy-middleware used in your project?

http-proxy-middleware@2.0.6

What http-proxy-middleware configuration are you using?

createProxyMiddleware(PROXY_PATH, {
    target: TARGET_URL,
    changeOrigin: true,
    pathRewrite: { [PROXY_PATH]: `/api/v1/` },
    secure: false
  })

What OS/version and node/version are you seeing the problem?

PopOs 22.04LTS && NodeJs v18.13.0

Additional context (optional)

No response

chimurai commented 1 year ago

Could you try to run your application with Node v14 and see if you have the same issue?