假设我输入一个(公共)网站,该网站在3个不同的端点上进行3个XHR/fetch呼叫:
我想实现的目标是拦截到 https://api.example.com/path2 仅,将其重定向到本地服务(Local -Host:8000)和让PATH1和PATH3贯穿原始域。
我在这里有什么样的选择?我已经研究了很多解决这个问题的方法:
- DNS重写 - 此解决方案不合适,因为我仍然必须拦截Path1和Path3,只有将它们重定向到原始IPS并尝试尽可能地模仿标头 - 这意味着我将必须为每个截断的域进行特定的代理配置 - 这是不可行的
- 镀铬扩展 - 发现没有一个专门处理单个端点,
- 截取了page loding fetter和xmlhttprequest oferpage off page load off page load oft page load-仍然没有涵盖所有场景fetch和xmlhttprequest的值之前(?)
Suppose I enter a (public) website that makes 3 XHR/fetch calls on 3 different endpoints:
What I want to achieve is intercept the call to https://api.example.com/path2 only, redirect it to a local service (localhost:8000) and let path1 and path3 through to the original domain.
What kind of options do I have here? I have studied a lot of approaches to this issue:
- DNS rewriting - this solution is not suitable as I still have to intercept path1 and path3, only redirect them to the original IPs and try to mimic the headers as much as possible - which means I would have to do a specific proxy configuration for each intercepted domain - this is unfeasible
- Chrome extensions - found none to deal specifically with single endpoint intercepting
- Overwriting both fetch and XmlHttpRequest after page load - still doesn't cover all scenarios, maybe some websites cache the values of fetch and XmlHttpRequest before page load (?)
发布评论
评论(1)
结合镀铬扩展名和获取覆盖物将起作用。
Combining the chrome extension and fetch overwrite will work.