gpt4 book ai didi

windows - HTTP 无法注册 URL

转载 作者:可可西里 更新时间:2023-11-01 12:43:04 28 4
gpt4 key购买 nike

我正在尝试启动一个使用端口 8081 的服务。该服务在启动后立即停止。我查看事件查看器,我看到了这个:

Service cannot be started. System.ServiceModel.AddressAlreadyInUseException: HTTP could not register URL https:// +:8081/api/. Another application has already registered this URL with HTTP.SYS. ---> System.Net.HttpListenerException: Failed to listen on prefix 'https:// +:8081/api/' because it conflicts with an existing registration on the machine.

我试图用 netsh 注册 url,但它说该文件已经存在,但我无法删除保留,它也没有出现在保留列表中 (netsh http show urlacl)。

netsh http add urlacl url=http:// +:8081/api/ user=\Everyone

Url reservation add failed, Error: 183 Cannot create a file when that file already exists.

netsh http delete urlacl url=https:// +:8081/api/

URL reservation delete failed, Error: 2 The system cannot find the file specified.

我可以做些什么来解决这个问题?

注意:该服务在另一台机器上运行良好。

最佳答案

必须有一个包含相同 url 的现有条目。您可以使用 show 命令来验证这一点,以发现存在哪些注册,也许可以将其通过管道传输到文件或根据需要通过 grep 获取端口号,例如

netsh http show urlacl > d:\tmp\out.txt

然后您可以删除旧条目(需要一个精确 url 匹配 - 注意 http 与 https,以及结尾的斜杠 - 最好从 show 命令的输出中复制粘贴)

netsh http delete urlacl url=theExactRegisteredUrl

然后添加一个包含你想要的选项的新条目

netsh http add urlacl url=theExactRegisteredUrl user=\Everyone

关于windows - HTTP 无法注册 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26466988/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com