TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Network Proxy for Development

1 点作者 Pranav2612000超过 3 年前
Recently, when I was working on a desktop application, I wanted to test it&#x27;s usability when certain APIs fail. For this I wanted to block a certain API, but couldn&#x27;t find a simple straightforward way to do this. Maybe I could&#x27;ve done something with the &#x2F;etc&#x2F;hosts file, but wasn&#x27;t able to make it do what I want. This got me thinking about developing a simple application, which creates a proxy to which we can connect to, and it allows us to blacklist urls. ( Further features can be defining the time taken by the API to respond back, setting a status code it responds back with etc )So, I have a few questions -<p>1. Is there a simple solution which allows us to do this ? 2. Do you think the solution is technically feasible ? 3. Would you be willing to use an application like this ? If Yes, What are some other use cases of the solution and what features do you think it should have ?

1 comment

aastronaut超过 3 年前
1. MITMProxy[1] is scriptable (Python API) to modify requests&#x2F;responses, or HTTP ToolKit[2] seems to be more on the non-code side (haven&#x27;t used it).<p>2. Sure, but there&#x27;s not much value in it. An API is the available contract for the communication between services. The server needs to guarantee it and the client can implement the needed parts. The client should implement solutions for server-side error cases either way, handle rate limiting, and send each request with a timeout. Everything else relies on the guarantee of the server, which, as the client, isn&#x27;t your responsibility.<p>3. Only when i need a quick workaround for a feature the server doesn&#x27;t provide (e.g. CORS injection) and maybe for test automation.<p>[1] <a href="https:&#x2F;&#x2F;mitmproxy.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mitmproxy.org&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;httptoolkit.tech&#x2F;" rel="nofollow">https:&#x2F;&#x2F;httptoolkit.tech&#x2F;</a>
评论 #29457357 未加载