1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

How to use mitmproxy with Angular

Discussão em 'Angular' iniciado por Katana24, Outubro 25, 2024 às 08:33.

  1. Katana24

    Katana24 Guest

    I think I'm misunderstanding how this is suppose to work so I'd like some clarification:

    I have an angular app with a proxy setup like so:

    {
    "/api": {
    "target": "http://127.0.0.1:8080",
    "secure": false,
    "logLevel": "debug"
    }
    }


    For the proxy to work with angular I need to send my HTTP requests to angular itself running on the same port:

    return this.http.get('http://localhost:4200/api');


    I want to use mitmproxy to intercept the requests and then forward them to a local Django server running on port 8000. But if I send the HTTP request to 8080 (mitmproxy's default port) by setting the target value it doesn't know how to forward the request and gets caught sending seemingly unlimited requests.

    So what do I need to set (in the headers) to get the HTTP request to go through mitmproxy and on to the Django server?

    Continue reading...

Compartilhe esta Página