XX-net / XX-Net

A proxy tool to bypass GFW.
33.07k stars 7.69k forks source link

如何在5.10.7版本中修改默认端口8086 #14062

Closed VincentFortuneDeng closed 2 months ago

VincentFortuneDeng commented 2 months ago

同样也在ubunt22.04中进行了相关测试,同样的配置,9090端口仍然无占用情况; 其实我只是通过Win11来测试如何修改端口,最终我的目的是修改unbuntu中的默认端口,因为阿里云PAI 镜像权限原因,8086端口无法绑定,我需要修改默认端口: 以下是阿里云PAI镜像中的启动错误,已经确认过8086端口实际无进程ID但仍然被占用,用户为root,权限足够但无法绑定8086,所以我要修改默认端口。 { Exception in thread smart_router_start: Traceback (most recent call last): File "/mnt/workspace/XX-Net/code/default/lib/noarch/simple_http_server.py", line 504, in add_listen sock.bind(addr) OSError: [Errno 98] Address already in use

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/mnt/workspace/XX-Net/python3/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/mnt/workspace/XX-Net/python3/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/mnt/workspace/XX-Net/code/default/smart_router/local/init.py", line 152, in start g.proxy_server.start() File "/mnt/workspace/XX-Net/code/default/lib/noarch/simple_http_server.py", line 472, in start self.init_socket() File "/mnt/workspace/XX-Net/code/default/lib/noarch/simple_http_server.py", line 487, in init_socket self.add_listen((ip, port)) File "/mnt/workspace/XX-Net/code/default/lib/noarch/simple_http_server.py", line 508, in add_listen raise Exception(err_string) Exception: bind to b'0.0.0.0':8086 fail:OSError(98, 'Address already in use') }

执行netstat -tunlp,查看无实际进程 { Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 10.224.164.73:10250 0.0.0.0: LISTEN -
tcp 0 0 127.0.0.1:111 0.0.0.0:
LISTEN -
tcp 0 0 127.0.0.1:8082 0.0.0.0: LISTEN 9068/node
tcp 0 0 0.0.0.0:22 0.0.0.0:
LISTEN 73/sshd: /usr/sbin/ tcp 0 0 127.0.0.1:8086 0.0.0.0:* LISTEN -
}

XLX commented 2 months ago

XX-Net\code\default\smart_router\local\__init__.py 看源码端口号是用的proxy_port(全小写),可以试试。 或者也可以考虑直接改源码里的端口号。 另外,如果不用SmartRouter也可以考虑直接禁用

VincentFortuneDeng commented 2 months ago

XX-Net\code\default\smart_router\local\__init__.py 看源码端口号是用的proxy_port(全小写),可以试试。 或者也可以考虑直接改源码里的端口号。 另外,如果不用SmartRouter也可以考虑直接禁用

非常感谢,proxy_port改为小写,调整了参数位置,并且重新下载了一份完整的.zip文件,干净的重新配置后解决了。