Change URL to another URL using mitmproxy

前端 未结 3 999
野性不改
野性不改 2020-12-15 14:16

I am trying to redirect one page to another by using mitmproxy and Python. I can run my inline script together with mitmproxy without issues, but I am stuck when it comes to

3条回答
  •  误落风尘
    2020-12-15 15:08

    You can set .url attribute, which will update the underlying attributes. Looking at your code, your problem is that you change the URL in the response hook, after the request has been done. You need to change the URL in the request hook, so that the change is applied before requesting resources from the upstream server.

提交回复
热议问题