【发布时间】:2013-03-20 20:13:50
【问题描述】:
我无法追踪是什么迫使 localhost:8000 和 localhost:8888 重定向到 localhost:8080。有没有人有一个想法?我在本地机器上,mac os x,而不是服务器。我使用过 jekyll、pow、haproxy、nodejs、webrick 和 mamp。目前它们都没有运行(据我所知)。
【问题讨论】:
我无法追踪是什么迫使 localhost:8000 和 localhost:8888 重定向到 localhost:8080。有没有人有一个想法?我在本地机器上,mac os x,而不是服务器。我使用过 jekyll、pow、haproxy、nodejs、webrick 和 mamp。目前它们都没有运行(据我所知)。
【问题讨论】:
有很多小工具可以为您做到这一点。搜索端口转发工具...
你也可以用 ssh 做一个隧道。
【讨论】:
这是一个 bash 脚本,它将终止在特定端口上运行的进程。
lsof -n -i4TCP:3000 | grep LISTEN | tr -s ' ' | cut -f 2 -d ' ' | xargs kill -9
只需将3000 替换为您想要终止的端口即可。
这应该会为您清除所有端口:
lsof -n -i4TCP:8080 | grep LISTEN | tr -s ' ' | cut -f 2 -d ' ' | xargs kill -9
lsof -n -i4TCP:8888 | grep LISTEN | tr -s ' ' | cut -f 2 -d ' ' | xargs kill -9
lsof -n -i4TCP:8000 | grep LISTEN | tr -s ' ' | cut -f 2 -d ' ' | xargs kill -9
【讨论】: