Localhost端口8000和8888重定向到8080

时间:2013-03-20 20:13:51

标签: localhost ports

我无法找到强制localhost:8000和localhost:8888重定向到localhost:8080的内容。那里有人有想法吗?我在本地机器上,mac os x,而不是服务器。我用过jekyll,pow,haproxy,nodejs,webrick和mamp。现在他们都没有跑(据我所知)。

2 个答案:

答案 0 :(得分:0)

有很多小工具可以帮到你。搜索端口转发工具......

您也可以使用ssh建立隧道。

答案 1 :(得分:0)

这是一个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
相关问题