如何使用 HTTPS 代理启动 VSCode chrome 调试器 [英] How to launch VSCode chrome debugger using HTTPS proxy

查看:57
本文介绍了如何使用 HTTPS 代理启动 VSCode chrome 调试器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I've launched chrome from VSCode before without an SSL proxy, so I'm guessing that is at the root of my issues. Here's my VSCode launch.json configuration:

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

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

I'm using webpack in watch mode which is launching on port 8000, and I'm running an Express https server proxy.

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

The launch config works fine to launch the url, but it does not activate breakpoints within VSCode.

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

I could not find any information on launch configuration specific to SSL.

有什么我可以尝试让调试器正常工作并激活这些断点的方法吗?

Is there anything I can try to get the debugger working properly, and get these breakpoints activated?

谢谢!

推荐答案

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

I'm able to start httpS Chrome debugging after some painful times, I'm using certificate generated by openSSL. Key is to make Chrome accept my certificate, tried so many solutions, finally here is the super easy way, type in this in Chrome's address box:

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

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

然后确保启用它

我的launch.json:

My launch.json:

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

这篇关于如何使用 HTTPS 代理启动 VSCode chrome 调试器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆