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

"http proxy-middleware" Events Handlers don't support async methods #861

Open
2 tasks done
marekachilles opened this issue Dec 13, 2022 · 0 comments
Open
2 tasks done

Comments

@marekachilles
Copy link

Checks

Describe the bug (be clear and concise)

The "http proxy-middleware" Events Handlers can't call on asnyc methods. It would be nice to be able to use them without a work around.

Step-by-step reproduction instructions

I use this workaround to call on async methods: 
proxyReq: (proxyReq, req, res) => {
            proxyReq.socket!.pause();
            get_user_permit(proxyReq).then((c) => {
                console.log("PERMIT ERTEILT ?", c , c!.ok());
                if(!c!.ok())
                {
                    proxyReq.destroy();
                    return;
                }         
                proxyReq.socket!.resume();         
            }).catch((err) => {
              proxyReq.socket?.destroy;
            });

Expected behavior (be clear and concise)

I should be able to call up async Methods without pausing and resuming the connection.

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

Using: "http-proxy-middleware": "^3.0.0-beta.0",

What http-proxy-middleware configuration are you using?

loggerPlugin, errorResponsePlugin, proxyEventsPlugin, createProxyMiddleware, responseInterceptor

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

Windows and node: '18.12.1'

Additional context (optional)

No response

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

1 participant