V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
爱意满满的作品展示区。
cloverstd

用 Golang 写了个 tcping

  •  
  •   cloverstd ·
    cloverstd · Oct 11, 2017 · 6310 views
    This topic created in 3127 days ago, the information mentioned may be changed or developed.

    来由

    以前工作的时候,经常需要看某个端口是否是通的,其实 telnet 完全可以胜任,但是 telnet 后面的地址只能是 ip port 这种形式,一般情况,地址复制来都是 ip:port 这种形式的,所以每次 telnet 都要手动去掉冒号,然后分割,有时复制来的地址还带协议,比如 https://www.baidu.com,这个时候就蛋疼了。

    然后我发现了 tcping 这个软件,但是秉承着造轮子的思想,我就用 Golang 重新造了一个。

    使用

    HTTP ping

    tcping https://baidu.com
    tcping -H baidu.com
    tcping -H baidu.com 80
    

    TCP ping

    tcping baidu.com
    tcping baidu.com:80
    tcping baidu.com 80
    

    安装

    MacOS

    brew tap cloverstd/tap && brew install tcping-go
    

    Linux

    下载对应的文件即可,下载地址 https://github.com/cloverstd/tcping/releases

    5 replies    2017-10-16 08:21:35 +08:00
    timothyye
        1
    timothyye  
       Oct 12, 2017
    已 star
    wwqgtxx
        2
    wwqgtxx  
       Oct 12, 2017 via iPhone
    不打算编译个 windows 版本么
    hjc4869
        3
    hjc4869  
       Oct 12, 2017 via Android
    @wwqgtxx Windows 直接上 psping,MS 官方出品
    vus520
        4
    vus520  
       Oct 15, 2017
    顺路求一个 ICMP 的 GO 实现
    afpro
        5
    afpro  
       Oct 16, 2017
    用 python 包一个 telnet 多好呐
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2813 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 13:53 · PVG 21:53 · LAX 06:53 · JFK 09:53
    ♥ Do have faith in what you're doing.