🧪 Run common networking tests against your site.

dstp

dstp, run common networking tests against your site.

dstp gif


Usage

Usage: dstp [OPTIONS] [ARGS]
Options:
	-a, --addr   
   
      The URL or the IP address to run tests against      [REQUIRED]
	-o, --out    
    
       The type of the output, either json or plaintext    [Default: plaintext] 
	-c           
     
          Run all the tests concurrently.                     [Default: false]
	-h, --help             Show this message and exit.

     
    
   

Motivation

A comment on lobste.rs, in a thread about DNS gave a great idea and thought a robust tool like that come in handy!

Installation

Packages

Homebrew

For Homebrew on macOS, install the ycd/tap/dstp formula.

brew install ycd/tap/dstp

Downloads

Binary downloads of example are available from the releases section on GitHub for 64-bit Windows, macOS, and Linux targets. They contain the compiled executable.

platform
macOS ARM 64 Bit
macOS 64 Bit
Linux 32-Bit
Linux ARM 64 Bit
Linux 64 Bit
Windows 64 Bit
Windows 32 Bit

Installation from source

  1. Verify that you have Go 1.16+ installed

    $ go version
    

    If go is not installed, follow instructions on the Go website.

  2. Clone this repository

    $ git clone https://github.com/ycd/dstp 
    $ cd dstp
    
  3. Build and install

    Unix/Linux

    # May require you to use sudo
    $ go build .
    $ cp dstp /usr/local/bin/dstp
    

    Mac/BSD

    # May require you to use sudo
    $ make
    $ cp dstp /usr/local/bin/dstp
    
  4. Verify installation

    $ dstp -h 
    
    Usage: dstp [OPTIONS] [ARGS]
    Options:
    -a, --addr   
         
            The URL or the IP address to run te![img.png](img.png)sts against      [REQUIRED]
    -o, --out    
          
             The type of the output, either json or plaintext    [Default: plaintext]
    -c           
           
                Run all the tests concurrently.                     [Default: false]
    -h, --help             Show this message and exit.
    
           
          
         

Contributing

All kinds of Pull Requests and Feature Requests are welcomed!

Licence

dstp's source code is licenced under the MIT License.

Owner
Yagiz Degirmenci
Yagiz Degirmenci
Comments
  • ping: socket: permission denied on WSL

    ping: socket: permission denied on WSL

    I got following error in WSL (Windows Subsystem for Linux) terminal (Ubuntu 20.04):

    me@JNNH00004L:~$ dstp https://google.com
    Ping: failed to run ping: socket: permission denied
    DNS: failed to run ping: socket: permission denied
    SystemDNS: resolving 216.58.201.78, 2a00:1450:4014:800::200e
    TLS: certificate is valid for 56 more days
    HTTPS: got 200 OK
    

    Ping command is working OK:

    me@JNNH00004L:~$ ping google.com
    PING google.com (216.58.201.78) 56(84) bytes of data.
    64 bytes from prg03s01-in-f78.1e100.net (216.58.201.78): icmp_seq=1 ttl=113 time=24.6 ms
    64 bytes from prg03s01-in-f78.1e100.net (216.58.201.78): icmp_seq=2 ttl=113 time=20.9 ms
    
  • [FEATURE] Support Alternate Ports

    [FEATURE] Support Alternate Ports

    Thanks for making such a useful tool! It would be swell if it could be used to test services running on alternate ports. Plex, for example, often uses port 32400:

    # A standard service listening on 443 with a trusted cert.
    ❯ dstp https://standardService.myDomain.tld
    Ping: 251.027µs
    DNS: resolving VALID_IP
    SystemDNS: resolving VALID_IP
    TLS: certificate is valid for 79 more days
    HTTPS: got 200 OK
    
    # A Plex server running remotely on port 32400 with a trusted cert.
    ❯ dstp https://plex.myDomian.tld:32400
    Ping: no response (this is expected from the location this server is running)
    DNS: resolving VALID_IP
    SystemDNS: resolving VALID_IP
    TLS: dial tcp VALID_IP:443: connect: connection timed out
    HTTPS: Get "https://plex.myDomain.tld": dial tcp VALID_IP:443: i/o timeout
    

    I got the same result passing the URL with the -a flag. The expectation is that the tests would use the port provided in this argument where applicable.

  • [FEATURE] Need of a timeout option ?

    [FEATURE] Need of a timeout option ?

    Hello!

    I tried with a website down like jetable.org But no answer/summary from the tool dstp 💥 Is there a timeout option ?

    ➜ dstp jetable.org
    ^C
    ~ took 8m 32s
    ➜ dig +short jetable.org
    193.200.42.56
    ➜ ping jetable.org
    PING jetable.org (193.200.42.56): 56 data bytes
    Request timeout for icmp_seq 0
    Request timeout for icmp_seq 1
    Request timeout for icmp_seq 2
    ^C
    --- jetable.org ping statistics ---
    4 packets transmitted, 0 packets received, 100.0% packet loss
    
  • [FEATURE] Add cron-job ability and announcers

    [FEATURE] Add cron-job ability and announcers

    Add cron-job ability so that the dstp can re-run the tests against the given site in the specified amount of time and add the logic for announcing results in slack, discord etc.

    An example usage in my mind:

    $ export SLACK_TOKEN="token"
    $ export SLACK_CHANNEL_ID="1234567"
    
    $ dstp --cron=300 --announce="slack" 8.8.8.8
    

    Then this re-runs the tests in every 5 minutes(300 sec) and announces the results to given slack channel.

    • [ ] Add cron-job logic
    • [ ] Add announcer for Slack.
    • [ ] Add announcer for Discord.
  • I also need something help with build bstp!

    I also need something help with build bstp!

    I try to using go install github.com/ycd/dstp/cmd/dstp,but I not get bstp binary; image Using go build cmd/dstp/main.go and I also cann`t get bstp binary! image

    my os info! image

  • [BUG] Issue with parsing -a/--addr

    [BUG] Issue with parsing -a/--addr

    Hello,

    I've noticed that I am unable to run the tests with ./dstp -a 8.8.8.8 on macOS (haven't tested on Linux yet). I've isolated the issue with how the flags are parsed in https://github.com/ycd/dstp/blob/1c9140cdbe66bf5245eca70cc98ab427d2e43865/config/config.go#L44

    I was able to isolate it by adding fmt.Println(values) in cmd/dstp/main.go and seeing that values was empty:

    $ make; sudo ./dstp -a 8.8.8.8
    go build -o dstp cmd/dstp/main.go
    Password:
    opts.Addr value: 8.8.8.8
    values variable value: []
    address cannot be empty
    
    Usage: dstp [OPTIONS] [ARGS]
    Options:
            -a, --addr   <string>  The URL or the IP address to run tests against      [REQUIRED]
            -o, --out    <string>  The type of the output, either json or plaintext    [Default: plaintext]
            -c           <bool>    Run all the tests concurrently.                     [Default: false]
            -h, --help             Show this message and exit.
    

    In order to run it, I have to update https://github.com/ycd/dstp/blob/1c9140cdbe66bf5245eca70cc98ab427d2e43865/config/config.go#L69 to remove the values size condition:

    $ tail config/config.go
    	if opts.Addr != "" { // && len(values) >= 1 {
                    // opts.Addr = values[0]
            } else {
                    fmt.Println(opts.Addr)
                    return nil, fmt.Errorf("address cannot be empty")
            }
    
            return opts, nil
    }
    
    $ make; sudo ./dstp -a 8.8.8.8
    go build -o dstp cmd/dstp/main.go
    Password:
    opts.Addr value: 8.8.8.8
    values variable value: []
    Ping: 329.766ms
    DNS: resolving 8.8.8.8
    TLS: certificate is valid for 60 more days
    HTTPS: got 200 OK
    

    Another issue I've noticed is that on macOS, you need to set pinger.SetPrivileged(true) on https://github.com/ycd/dstp/blob/1c9140cdbe66bf5245eca70cc98ab427d2e43865/pkg/ping/ping.go#L13 and https://github.com/ycd/dstp/blob/1c9140cdbe66bf5245eca70cc98ab427d2e43865/pkg/ping/ping.go#L41 and run dstp with sudo. I suppose that it's the same issue as on Linux.

    go version:

    $ go version
    go version go1.17.2 darwin/amd64
    

    OS:

    $ uname -a
    Darwin 20.6.0 Darwin Kernel Version 20.6.0: Tue Oct 12 18:33:42 PDT 2021; root:xnu-7195.141.8~1/RELEASE_X86_64 x86_64
    
  • [Documentation] Update README for installation with go command

    [Documentation] Update README for installation with go command

    Hello there :wave:

    I am currently trying the tool and I installed it with go install.

    By copy/pasting the command from the CLI, I got the following error

    go install: version is required when current directory is not in a module
    	Try 'go install github.com/ycd/dstp/cmd/dstp@latest' to install the latest version
    

    Using the following does not solve the installation:

    go install github.com/ycd/dstp/cmd/dstp@latest
    

    Do you have an idea how it could be installed with go ?

  • Timeout support for unresponsive targets

    Timeout support for unresponsive targets

    Hi, nice idea :)

    So, what am I trying to achieve here?

    Let's talk about the go-ping library:

    go-ping will work correctly when a target is not responding, as long as a Timeout value was specified.

    If one only specifies a Count and an Interval values, the library will not return when a target does not send response packets (typically because it is unreachable)

    Under the hood, it appears that, while the library deals correctly with local ("interval") timeouts, and makes a note that all its "Count" outbound ICMP packets were sent, it still expects a matching number of reply packets before giving up.

    Therefore, I added two arguments:

    • -c to specify an alternate attempt count (not a mandatory change!) with the default number of packets remaining 3
    • -t to provide a global timeout, after which dstp will consider the target "unresponsive."

    If -t is not specified, the default timeout value is set to "a high number" multiplied by the number of ping packets. I picked 10 seconds as a high number for ping performance, therefore the default timeout would be 30 seconds to send 3 packets.

  • system vs DNS resolution

    system vs DNS resolution

    One distinction that could be useful is to do both a resolution through the system, like by calling gethostbyname() in the glibc, and doing the DNS resolution manually by querying the root DNS servers or 8.8.8.8. Both can yield different results and help inform why a host might fail.

    There are many reasons why a system resolver might yield a different result. A few that come to mind:

    • caching: the system resolver, or ISP resolver might be caching some old results
    • /etc/hosts file has an entry for that hostname
    • the /etc/resolv.conf has a search domain, that has an entry. If the original hostname doesn't exist, it would fall back on that one.
  • Failure in go test

    Failure in go test

    go test does not get passed on https://github.com/ycd/dstp/releases/tag/v0.4.0: https://github.com/aminvakil/aur/runs/5522345117?check_suite_focus=true#step:11:95

    go: downloading github.com/kr/pretty v0.2.1
    go: downloading github.com/google/go-cmp v0.5.6
    go: downloading github.com/yuin/goldmark v1.4.0
    go: downloading github.com/kr/text v0.1.0
    package github.com/rhysd/actionlint/playground
    	imports syscall/js: build constraints exclude all Go files in /usr/lib/go/src/syscall/js
    
  • Add support for expired certificates

    Add support for expired certificates

    When the certificate is expired is necessary to show a message that reflects that the certificate is expired and not to show that certificate will expire with negative values.

Related tags
Turbine-common - This package contains the common interfaces for Turbine that are shared with other software

turbine-common This package contains the common interfaces for Turbine that are

Feb 12, 2022
High performance async-io(proactor) networking for Golang。golangのための高性能非同期io(proactor)ネットワーキング
High performance async-io(proactor) networking for Golang。golangのための高性能非同期io(proactor)ネットワーキング

gaio Introduction 中文介绍 For a typical golang network program, you would first conn := lis.Accept() to get a connection and go func(net.Conn) to start a

Dec 29, 2022
🚀 gnet is a high-performance, lightweight, non-blocking, event-driven networking framework written in pure Go./ gnet 是一个高性能、轻量级、非阻塞的事件驱动 Go 网络框架。
🚀 gnet is a high-performance, lightweight, non-blocking, event-driven networking framework written in pure Go./ gnet 是一个高性能、轻量级、非阻塞的事件驱动 Go 网络框架。

English | ???? 中文 ?? Introduction gnet is an event-driven networking framework that is fast and lightweight. It makes direct epoll and kqueue syscalls

Jan 2, 2023
Fast event-loop networking for Go
Fast event-loop networking for Go

evio is an event loop networking framework that is fast and small. It makes direct epoll and kqueue syscalls rather than using the standard Go net pac

Dec 31, 2022
Packiffer is a lightweight cross-platform networking toolkit that let you sniff/analyze/inject/filter packets.
Packiffer is a lightweight cross-platform networking toolkit that let you sniff/analyze/inject/filter packets.

Packiffer is a lightweight cross-platform networking toolkit that let you sniff/analyze/inject/filter packets.

Dec 19, 2022
A decentralized P2P networking stack written in Go.

noise noise is an opinionated, easy-to-use P2P network stack for decentralized applications, and cryptographic protocols written in Go. noise is made

Dec 29, 2022
Netpoll is a high-performance non-blocking I/O networking framework, which focused on RPC scenarios, developed by ByteDance.
Netpoll is a high-performance non-blocking I/O networking framework, which focused on RPC scenarios, developed by ByteDance.

Netpoll is a high-performance non-blocking I/O networking framework, which focused on RPC scenarios, developed by ByteDance. RPC is usually heavy on processing logic and therefore cannot handle I/O serially. But Go's standard library net designed blocking I/O API, so that the RPC framework can only follow the One Conn One Goroutine design.

Jan 2, 2023
Fork of Go stdlib's net/http that works with alternative TLS libraries like refraction-networking/utls.

github.com/ooni/oohttp This repository contains a fork of Go's standard library net/http package including patches to allow using this HTTP code with

Sep 29, 2022
High-performance, non-blocking, event-driven, easy-to-use networking framework written in Go, support tls/http1.x/websocket.

High-performance, non-blocking, event-driven, easy-to-use networking framework written in Go, support tls/http1.x/websocket.

Jan 8, 2023
Hybridnet is an open source container networking solution, integrated with Kubernetes and used officially by following well-known PaaS platforms

Hybridnet What is Hybridnet? Hybridnet is an open source container networking solution, integrated with Kubernetes and used officially by following we

Jan 4, 2023
Basic Got chat program using Ably for networking

Go Terminal Chat Basic Got chat program using Ably for networking. Taken from GopherCon UK 2021: Tom Camp - Creating a basic chat app. Setup Replace t

Nov 30, 2021
NAT puncher for Wireguard mesh networking.

natpunch-go This is a NAT hole punching tool designed for creating Wireguard mesh networks. It was inspired by Tailscale and informed by this example.

Dec 12, 2022
Zero Trust Network Communication Sentinel provides peer-to-peer, multi-protocol, automatic networking, cross-CDN and other features for network communication.
Zero Trust Network Communication Sentinel provides peer-to-peer, multi-protocol, automatic networking, cross-CDN and other features for network communication.

Thank you for your interest in ZASentinel ZASentinel helps organizations improve information security by providing a better and simpler way to protect

Nov 1, 2022
Code for the website / Código para o site

Site crdpa.net Code for the new website This is the frontend and backend code for my new website. It is for my use only. If you want to use it, you ar

May 11, 2022
Local development against a remote Kubernetes or OpenShift cluster
Local development against a remote Kubernetes or OpenShift cluster

Documentation - start here! ** Note: Telepresence 1 is being replaced by our even better Telepresence 2. Please try Telepresence 2 first and report an

Jan 8, 2023
Scripts and other small tools developed against TCM systems

TCM Tools This repo contains scripts and small tools developed against TCM services that do not really have a home other places but we would like to m

Mar 22, 2022
A little tool to test IP addresses quickly against a geolocation and a reputation API

iptester A little tool to test IP addresses quickly against a geolocation and a

May 19, 2022
Protoc plugin to generate contract tests for gRPC in Go

Deal - Go Introduction WE DO NOT SUPPORT THE SERVER SIDE YET This plugin allows us to write Consumer-Driver Contracts tests! Usage example Proto servi

Sep 3, 2022
Small template for a go service that includes postgres/redis/proxying/mocha tests

go-service-template Small template for a go service that includes postgres/redis/proxying/mocha tests All instances of this service are named 'foobar'

Feb 26, 2022