【问题标题】:How to launch VSCode chrome debugger using HTTPS proxy如何使用 HTTPS 代理启动 VSCode chrome 调试器
【发布时间】:2021-01-23 22:33:44
【问题描述】:

我之前在没有 SSL 代理的情况下从 VSCode 启动了 chrome,所以我猜这是我问题的根源。这是我的 VSCode launch.json 配置:

{
    "name": "Launch Chrome",
    "request": "launch",
    "type": "pwa-chrome",
    "url": "https://example.com:8000",
    "webRoot": "${workspaceFolder}"
}

我在监视模式下使用 webpack,它在端口 8000 上启动,并且我正在运行 Express https 服务器代理。

启动配置可以很好地启动 url,但它不会激活 VSCode 中的断点。

我找不到任何有关特定于 SSL 的启动配置的信息。

有什么办法可以让调试器正常工作并激活这些断点?

谢谢!

【问题讨论】:

  • 你发现了吗?我也有同样的需求。
  • @GarySheppard 请看我的回答。你应该可以做到没有问题。我正在调试 Angular。我面临的唯一一个问题是我的 API 服务器也是运行自签名证书的节点,我能够解决 Postman 和 Chrome 访问 API 中的证书问题,但 VSC Chrome 总是返回 name: 'HttpErrorResponse', status: 0, statusText: 'Unknown Error', url: 'https://localhost:3001/whatever'

标签: node.js visual-studio-code https vscode-debugger


【解决方案1】:

经过一段痛苦的时光后,我能够开始 httpS Chrome 调试,我使用的是由 openSSL 生成的证书。关键是让Chrome接受我的证书,试了这么多办法,终于有一个超级简单的方法了,在Chrome的地址栏输入这个:

chrome://flags/#allow-insecure-localhost

然后确保启用它

我的launch.json:

{
    "type": "chrome",
    "request": "launch",
    "name": "F5 against localhost",
    "port": 4201,
    "url": "https://localhost:4200",
    "webRoot": "${workspaceFolder}"
}

【讨论】:

    猜你喜欢
    • 2022-11-24
    • 2019-02-21
    • 2018-03-29
    • 1970-01-01
    • 1970-01-01
    • 2020-07-13
    • 2015-10-27
    • 1970-01-01
    • 2010-09-09
    相关资源
    最近更新 更多