【问题标题】:Localhost port 8000 and 8888 redirect to 8080localhost 端口 8000 和 8888 重定向到 8080
【发布时间】:2013-03-20 20:13:50
【问题描述】:

我无法追踪是什么迫使 localhost:8000 和 localhost:8888 重定向到 localhost:8080。有没有人有一个想法?我在本地机器上,mac os x,而不是服务器。我使用过 jekyll、pow、haproxy、nodejs、webrick 和 mamp。目前它们都没有运行(据我所知)。

【问题讨论】:

    标签: localhost ports


    【解决方案1】:

    有很多小工具可以为您做到这一点。搜索端口转发工具...

    你也可以用 ssh 做一个隧道。

    【讨论】:

    • 我想我可能用错了标题。端口正在转发,我不知道如何/为什么。我该如何停止转发?
    【解决方案2】:

    这是一个 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
    

    【讨论】:

      猜你喜欢
      • 2021-01-31
      • 1970-01-01
      • 2012-09-29
      • 1970-01-01
      • 2012-07-21
      • 2017-03-31
      • 2018-08-07
      • 2021-04-14
      • 2019-06-04
      相关资源
      最近更新 更多