firefox - 如何使用curl 通过代理模拟来自Firefox 的请求?

标签 firefox curl https proxy

特别是,当我将 Firefox 设置为使用 https 流量代理时,我试图复制 Firefox 的行为。

根据我的测试,Firefox 似乎向代理发送 CONNECT 请求,而以下curl 命令直接向代理发送 GET。

curl --proxy-basic mydomain.com:8001 https://www.google.com

如何使curl 的行为像firefox 一样用于HTTPS 连接代理的测试目的?

EDIT1:问题不在于用户代理,因为我并不想欺骗代理以为我是 Firefox,只是为了帮助代理以 Firefox 的方式运行。

最佳答案

我已经通过 Firebug 完成了此操作。

安装 Firebug 后,请按照以下步骤操作:

  1. 右键单击 Firefox 中的网页并选择此选项:

enter image description here

  • 选择网络选项卡
  • enter image description here

  • 刷新页面

  • 右键单击要模拟的 URL 请求

  • 选择复制为 cURL

  • enter image description here

  • 您要模拟的 URL 请求现已位于剪贴板中。
  • 关于firefox - 如何使用curl 通过代理模拟来自Firefox 的请求?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15333660/

    相关文章:

    html - div 中的输入复选框在 Firefox 上跳转到页面顶部

    python - 使用 curl 将文件上传到 python flask 服务器

    bash - 百分号 % 在 crontab 中不起作用

    css - 在 http 和 https 页面中使用的 css 文件中使用 fonts.googleapis.com 的最佳方法是什么?

    ssl - 在共享主机上验证 SSL 证书

    html - HTML 表单的跨浏览器兼容性问题

    tensorflow - 在 Firefox 中使用 web worker 训练 LSTM 不适用于 tensorflow js

    css - jpg 在 Windows 7 上的 firefox 6 和 7 中看起来不同

    php - Curl GET 响应空结果

    asp.net-mvc - 当我使用 mvc 在 https 中发布表单时,密码可见