Skip to content

Intercept and modify the response sent by the proxied server #469

@SorinGFS

Description

@SorinGFS

This a question

I try to build a proxy using express, and I want it to be transparent except for jwt access tokens. Basically, I want to manage the authentication at proxy level. Specifically, it is about Strapi that provides an access token valid for one month without the possibility of adjustment, and I want to store that token and issue tokens with lower validity to be managed at the proxy level.
I analyzed several middlewares to find the one that can intercept the Strapi token and gives the possibility to modify the sent answer. I could only find middleware that intercepts the token sent by the client.
My question is: can this middleware intercept and modify the response sent by the proxied server? If so, what function do I need? Can anyone show me an example?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions