解决 windows:An attempt was made to access a socket in a way forbidden by its access permissions

简介: 解决 windows:An attempt was made to access a socket in a way forbidden by its access permissions

正文


今天在一个软件中遇到如下的错误:

D:\v4_tool\x2xxxW\x2xxxW\x2xxx-core>.\x2xxx.exe
x2xxx 4.43.0 (X2xxx, a community-driven edition of x2xxx.) Custom (go1.17.1 windows/amd64)
A unified platform for anti-censorship.
2022/11/22 20:32:56 Using default config:  D:\v4_tool\x2xxxW\x2xxxW\x2xxx-core\config.json
2022/11/22 20:32:56 [Info] main/jsonem: Reading config: D:\v4_tool\x2xxxW\x2xxxW\x2xxx-core\config.json
Failed to start app/proxyman/inbound: failed to listen TCP on 1080 > transport/internet: failed to listen on address: 127.0.0.1:1080 > transport/internet/tcp: failed to listen TCP on 127.0.0.1:1080 > listen tcp 127.0.0.1:1080: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

乍一看,就是端口占用呗,可离谱的地方在于:使用端口检查的命令根本找不着被占用的端口

netstat -ano | findstr ":1080"

8.webp.jpg

端口并没被使用


这我就郁闷了!心里一想,刚刚也就装了个 Docker 啊?算了,简单期间,就把 Docker 必须是重大嫌疑!

于是我百度了下一个新的关键词 docker 1081,还真有人和我一样:

88.webp.jpg


好吧,开始修复。


解决步骤


  1. 查看禁止使用的端口号

netsh interface ipv4 show excludedportrange protocol=tcp
协议 tcp 端口排除范围
开始端口    结束端口
----------    --------
      1068        1167
      1168        1267
      1368        1467
      1468        1567
      1568        1667
      1668        1767
      1768        1867
      1868        1967
      1973        2072
      2180        2279
     18000       18000
     50000       50059     *
* - 管理的端口排除。


  1. 发现我要使用的 1081 端口,确实被禁止了
  2. 重新修改这类端口范围

C:\WINDOWS\system32>netsh int ipv4 set dynamicport tcp start=50000 num=500
确定。


  1. 重启电脑


搞定


又可以愉快的使用1081端口了。

目录
相关文章
|
2月前
|
Java 数据库连接 数据库
Windows7 64位 连接Access数据库“未发现数据源名称并且未指定默认驱动程序“的解决办法
Windows7 64位 连接Access数据库“未发现数据源名称并且未指定默认驱动程序“的解决办法
|
PyTorch 算法框架/工具 Windows
【Windows pytorch-gpu环境】RuntimeError: Attempt to start a new process before the current process has
【Windows pytorch-gpu环境】RuntimeError: Attempt to start a new process before the current process has
146 0
|
开发工具 数据安全/隐私保护 git
Windows git remote: HTTP Basic: Access denied 错误解决办法
Windows 使用Git的git push 报 HTTP Basic: Access denied 错误
446 0
|
安全 数据安全/隐私保护 Windows