16 lines
832 B
PowerShell
16 lines
832 B
PowerShell
# 简化的防火墙配置脚本
|
|
Write-Host "正在配置Windows防火墙..." -ForegroundColor Green
|
|
|
|
# 添加前端端口规则
|
|
netsh advfirewall firewall add rule name="Node.js Frontend Port 5300" dir=in action=allow protocol=TCP localport=5300
|
|
Write-Host "前端端口5300规则已添加" -ForegroundColor Green
|
|
|
|
# 添加后端端口规则
|
|
netsh advfirewall firewall add rule name="Node.js Backend Port 5350" dir=in action=allow protocol=TCP localport=5350
|
|
Write-Host "后端端口5350规则已添加" -ForegroundColor Green
|
|
|
|
Write-Host "防火墙配置完成!" -ForegroundColor Green
|
|
Write-Host "现在其他用户可以通过以下地址访问:" -ForegroundColor Yellow
|
|
Write-Host "前端: http://172.28.112.1:5300" -ForegroundColor White
|
|
Write-Host "后端: http://172.28.112.1:5350" -ForegroundColor White
|