我云服务器的远行了 code-server 容器,外网可以访问进来,
my-code(code-server) 容器监听三个端口,
6080:8080是vscode服务,可以正常访问
6060:3000, 预留 vue测试用
6070:9000, 预留
在宿主机上,netstat -nltp 可看到my-code容器端口信息如下:
0.0.0.0:6060->3000/tcp, :::6060->3000/tcp, 0.0.0.0:6080->8080/tcp, :::6080->8080/tcp, 0.0.0.0:6070->9000/tcp, :::6070->9000/tcp my-code
现code-server运行 vue的测试, 运行命令 npm run dev ,正常运行:
vite v2.6.14 dev server running at:
> Local: http://localhost:3000/
> Network: use `--host` to expose
ready in 212ms.
我访问,服务器ip:6060 却进不了 vue的测试网页, 这个怎么解?不能测试就失去了code-server的意义了
服务器ip:6080 vscode-server 页面可进入.
容器内部端口情况,显示 vue 启用listen了:
root@492fde14c35b:/# netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 32/node
tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN 15132/node