{"id":23535028,"url":"https://github.com/ripta/netdebug","last_synced_at":"2025-05-14T20:35:03.717Z","repository":{"id":61679781,"uuid":"552670220","full_name":"ripta/netdebug","owner":"ripta","description":"Collection of network tools","archived":false,"fork":false,"pushed_at":"2025-05-06T00:48:32.000Z","size":296,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-07T22:56:07.792Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ripta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-17T03:27:46.000Z","updated_at":"2025-05-06T00:48:34.000Z","dependencies_parsed_at":"2022-10-20T04:15:17.800Z","dependency_job_id":"a6e17c4f-b84c-4e9a-bb7d-112bc0580ade","html_url":"https://github.com/ripta/netdebug","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripta%2Fnetdebug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripta%2Fnetdebug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripta%2Fnetdebug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripta%2Fnetdebug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ripta","download_url":"https://codeload.github.com/ripta/netdebug/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254222006,"owners_count":22034803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-26T01:14:27.199Z","updated_at":"2025-05-14T20:35:03.666Z","avatar_url":"https://github.com/ripta.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"netdebug -- a collection of network debug tooling\n\nSubcommands:\n\n  - `dns` performs a DNS query\n  - `echo` runs an HTTP or gRPC echo server.\n  - `listen` runs a TCP server.\n  - `send` creates a TCP connection and sends a payload.\n\n## `dns`\n\n```\nnetdebug dns -t mx github.com\nnetdebug dns -d 1.1.1.1:53 -t mx github.com\n```\n\n## `echo`\n\n```\n# Run with default settings: HTTP/1, port 8080\nnetdebug echo\n\n# Listen only on 127.0.0.1\nnetdebug echo --host=127.0.0.1\n\n# Run HTTP/2 with self-signed certificate, port 8443\nnetdebug echo --tls-autogenerate --port=8443\n```\n\ngRPC mode has server reflection enabled, and thus you can:\n\n```\n# Run gRPC with self-signed certificate, port 8443\nnetdebug echo --tls-autogenerate --port=8443 --mode=grpc\n\n# and then...\ngrpcurl -insecure localhost:8443 list\n```\n\n### `pkg.echo.v1.Echoer/Echo`\n\n```\n# Run gRPC with self-signed certificate, port 8443\nnetdebug echo --tls-autogenerate --port=8443 --mode=grpc\n\ngrpcurl -insecure -d '{\"query\":\"deadbeef\"}' -rpc-header 'x-foo-id: bar-123' localhost:8443 pkg.echo.v1.Echoer.Echo\n```\n\nThere's also a grpc and HTTP mode:\n\n```\n# Run gRPC and HTTP with self-signed certificate, port 8443\nnetdebug echo --tls-autogenerate --port=8443 --mode=grpc+http\n\n# gRPCurl will still work:\ngrpcurl -insecure localhost:8443 list\n\n# as will regular curl with HTTP/1 and HTTP/2\ncurl --http1.1 -k https://localhost:8443/\ncurl --http2 -k https://localhost:8443/\n```\n\nIn fact, with the help of `protoc`, `grpcto`, and `curl`, you can hand-craft a gRPC request over HTTPS:\n\n```\n# Run gRPC and HTTP with self-signed certificate, port 8443\nnetdebug echo --tls-autogenerate --port=8443 --mode=grpc+http\n\necho 'query:\"fizzbuzz\"' \\\n    | protoc --encode pkg.echo.v1.EchoRequest ./pkg/echo/v1/echo.proto \\\n    | grpcto frame \\\n    | curl -X POST -k -v --data-binary @- -H \"Content-Type: application/grpc\" --raw https://localhost:8443/pkg.echo.v1.Echoer/Echo \\\n    | grpcto unframe \\\n    | protoc --decode_raw\n```\n\nor HTTP:\n\n```\n# Run gRPC and HTTP\nnetdebug echo --port=8080 --mode=grpc+http\n\necho 'query:\"fizzbuzz\"' \\\n    | protoc --encode pkg.echo.v1.EchoRequest ./pkg/echo/v1/echo.proto \\\n    | grpcto frame \\\n    | curl -X POST -v --data-binary @- -H \"Content-Type: application/grpc\" --raw --http2 --http2-prior-knowledge http://localhost:8443/pkg.echo.v1.Echoer/Echo \\\n    | grpcto unframe \\\n    | protoc --decode_raw\n```\n\n### `pkg.echo.v1.Echoer/Status`\n\nThere's also a `Status` procedure that allows you to request that the server return arbitrary errors:\n\n```\n# Run gRPC\nnetdebug echo --port=8080 --mode=grpc\n\ngrpcurl -v -plaintext -d '{\"force_grpc_status\":3,\"message\":\"oopsie!\"}' localhost:8080 pkg.echo.v1.Echoer/Status\n```\n\nwhich might return something like:\n\n```\nResolved method descriptor:\nrpc Status ( .pkg.echo.v1.StatusRequest ) returns ( .pkg.echo.v1.StatusResponse );\n\nRequest metadata to send:\n(empty)\n\nResponse headers received:\ncontent-type: application/grpc\ntrailer: Grpc-Status\ntrailer: Grpc-Message\ntrailer: Grpc-Status-Details-Bin\n\nResponse trailers received:\n(empty)\nSent 1 request and received 0 responses\nERROR:\n  Code: InvalidArgument\n  Message: oopsie!\n```\n\n## `listen` and `send`\n\nStart listening in one terminal:\n\n```\nnetdebug listen --port=20202\n```\n\nand send stuff to it in a different terminal:\n\n```\ndate | netdebug send --address=localhost:20202\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fripta%2Fnetdebug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fripta%2Fnetdebug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fripta%2Fnetdebug/lists"}