Windows HTTP 服务器

记录遇到的一个坑,使用HttpAddUrl方法,绑定的URL 只能写成:http://localhost:8080/

访问时只能用这个地址访问,127.0.0.1 和 局域网IP 都不行

因为需要添加URL保留项:

用管理身份打开CMD,输入以下内容:

netsh http add urlacl url=http://127.0.0.1:8080/ user=EVERYONE listen=yes delegate=no

就能用以上地址访问了

参考:
对于非管理员用户,localhost上的HttpAddUrl失败

 

posted @ 2022-09-05 20:26  番茄玛丽  阅读(136)  评论(0编辑  收藏  举报