我如何与ngrok一起使用proxy.py

发布于 2025-02-08 20:31:30 字数 752 浏览 2 评论 0 原文

我正在尝试使用代理。Py一个python库,该库在我的Localhost:8899上运行。我试图通过使用NGrok HTTP 8899来使端口实时。现在,我正在尝试访问由Ngrok生成的代理URL作为请求中的proix。但是无法获得回应。 run代理命令的步骤

  1. 以下是我遵循pip install proxy.py
  2. 。代理在端口8899上运行。
  3. 使用nGrok并生成以下链接
import requests
resp = requests.get("http://httpbin.org/ip",proxies={'http':'http://0ebe-117-220-248-73.ngrok.io'}).text
print(resp)

试图将其用作LIB请求中的代理。 但是无法击中代理

  1. 以下工作正常,
import requests
resp = requests.get("http://httpbin.org/ip",proxies={'http':'http://localhost:8899'}).text
print(resp)

有任何方法可以将端口8899公开,以便我可以从另一个系统中使用代理

I am trying to use proxy.py a python library which runs on my localhost:8899. The I tried to make the port live by using ngrok http 8899. Now I am trying to access the proxy url which is generated by ngrok as proixes in request. But am unable to fetch the response. The following are the step I followed

  1. pip install proxy.py
  2. run proxy command in terminal. The proxy is running on port 8899.
  3. used ngrok and generated the following link http://0ebe-117-220-248-73.ngrok.io
import requests
resp = requests.get("http://httpbin.org/ip",proxies={'http':'http://0ebe-117-220-248-73.ngrok.io'}).text
print(resp)

Tried to use it as proxy in requests lib.
But unable to hit the proxy

  1. The following works fine
import requests
resp = requests.get("http://httpbin.org/ip",proxies={'http':'http://localhost:8899'}).text
print(resp)

Is there any way to make port 8899 public so that I can use the proxy from another system

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文