launch.json:本地主机拒绝连接

时间:2018-09-20 19:35:00

标签: visual-studio-code

Windows 10
Visual Studio代码
Chrome调试器

我遇到launch.json文件的问题。如果我使用这种配置,那么我的index.html文件将在Google Chrome浏览器中成功打开:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "file": "${workspaceFolder}/index.html"
        }
    ]
}

但是我对第二种配置有疑问:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://localhost:8080/index.html",
            "webRoot": "${workspaceFolder}"
        }
    ]
}

结果:

enter image description here

我该如何解决?

0 个答案:

没有答案
相关问题