{"id":20858822,"url":"https://github.com/controlplaneio/netassertv2-l4-client","last_synced_at":"2026-02-04T22:36:40.213Z","repository":{"id":168963621,"uuid":"598694455","full_name":"controlplaneio/netassertv2-l4-client","owner":"controlplaneio","description":"This repo houses the Layer 4 (TCP/UDP) client used by Netassert v2","archived":false,"fork":false,"pushed_at":"2026-01-27T10:04:01.000Z","size":92,"stargazers_count":0,"open_issues_count":1,"forks_count":2,"subscribers_count":14,"default_branch":"main","last_synced_at":"2026-01-27T22:24:18.874Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/controlplaneio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-02-07T16:19:00.000Z","updated_at":"2026-01-27T09:54:49.000Z","dependencies_parsed_at":"2024-08-15T19:59:48.981Z","dependency_job_id":"8b382e36-c544-40cf-bb53-608f9b295d31","html_url":"https://github.com/controlplaneio/netassertv2-l4-client","commit_stats":null,"previous_names":["controlplaneio/netassertv2-l4-client"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/controlplaneio/netassertv2-l4-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/controlplaneio%2Fnetassertv2-l4-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/controlplaneio%2Fnetassertv2-l4-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/controlplaneio%2Fnetassertv2-l4-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/controlplaneio%2Fnetassertv2-l4-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/controlplaneio","download_url":"https://codeload.github.com/controlplaneio/netassertv2-l4-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/controlplaneio%2Fnetassertv2-l4-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29098240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T21:05:08.033Z","status":"ssl_error","status_checked_at":"2026-02-04T21:04:53.031Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-11-18T04:47:39.761Z","updated_at":"2026-02-04T22:36:40.196Z","avatar_url":"https://github.com/controlplaneio.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Netassertv2-l4-client\n\n[![Testing Workflow][testing_workflow_badge]][testing_workflow_badge]\n[![Release Workflow][release_workflow_badge]][release_workflow_badge]\n\nThe `Netassertv2-l4-client` is a Go program designed to open TCP / UDP connections toward a specified destination and send a configurable string payload.\n\nA test comprises one or more connection attempts, and a passed test results in the client exiting with a status code of 0 (1 otherwise).\n\nYou can pull the latest Docker image from `docker.io/controlplane/netassertv2-l4-client:latest`\n\n## Configuration\n\nThe client accepts the following environment variables:\n\n| Environment Variable | Go Type | Default Value | Purpose |\n| --- | --- | --- | --- |\n| TARGET_HOST | string |  | The target host to test (mandatory), it can be an IP or a domain name |\n| TARGET_PORT | uint16 |  | The target port to test (mandatory) |\n| PROTOCOL | string | tcp | Protocol, tcp or udp |\n| MESSAGE | string | defaultmessage | The string to use as payload |\n| PERIOD | uint | 5000 | Interval between connections in milliseconds |\n| TIMEOUT | uint | 2000 | Period of time in milliseconds after which the connection is considered failed |\n| ATTEMPTS | uint | 1 | Number of connections to create (regardless of their failed / successful statuses) |\n| SUCCESS_THRESHOLD | uint | 80 | Percentage of successful connections above which the whole test is considered passed |\n| LOG_LEVEL | string | info | Log level, available: (debug, info, warn, error) |\n| LOG_ENCODING | string | console | Log encoding, available: (console, json) |\n\nParameters can also be passed as command line arguments. These take precedence over environment variables in case both are defined for the same parameter. Command line args are named as lowered-case environment variables and with \"`-`\" replaced by \"`_`\".\n\n## Build and Run\n\nBuild the client:\n\n```bash\nmake build\n```\n\nAnd run it providing at least a target host and a port, for example:\n\n```bash\n./bin/netassertv2-l4-client --target-host 192.168.1.10 --target-port 8443\n```\n\nIf the host is not reachable and / or there is not a service listening on the specified port, the connection(s) will fail.\n\nMultiple connections can run in parallel, for example when connections fail due to timeout and the `period` parameter is less than `timeout`, or, more in general, if a connection takes more than `period` to complete.\n\n## Example\n\nA valid host can be created using netcat in server mode:\n\n```bash\nwhile true; do nc -vl localhost 12345; done\n```\n\nOn a different tab, run the client:\n\n```bash\n./bin/netassertv2-l4-client --target-host=localhost --target-port=12345 --attempts 3 --message $'examplemessage\\n'\n```\n\nClient output:\n\n```bash\n2023/03/09 15:49:38 maxprocs: Leaving GOMAXPROCS=16: CPU quota undefined\n2023-03-09T15:49:38.166+0100\tINFO\tcobra@v1.6.1/command.go:916\t\u0026{LogLevel:info LogEncoding:console Protocol:tcp TargetHost:localhost TargetPort:12345 Message:examplemessage\n Timeout:2000 Attempts:3 Period:5000 SuccThrPec:80}\n2023-03-09T15:49:38.168+0100\tINFO\truntime/asm_amd64.s:1598\tsuccessful connection and data sent to localhost:12345\n2023-03-09T15:49:43.171+0100\tINFO\truntime/asm_amd64.s:1598\tsuccessful connection and data sent to localhost:12345\n2023-03-09T15:49:48.170+0100\tINFO\truntime/asm_amd64.s:1598\tdone creating connections\n2023-03-09T15:49:48.171+0100\tINFO\tconntester/conntester.go:93\twaiting for connections to stop...\n2023-03-09T15:49:48.172+0100\tINFO\truntime/asm_amd64.s:1598\tsuccessful connection and data sent to localhost:12345\n2023-03-09T15:49:48.172+0100\tINFO\tconntester/conntester.go:93\tall connections have finished\n2023-03-09T15:49:48.173+0100\tINFO\truntime/asm_amd64.s:1598\tsuccess rate of: 100\n2023-03-09T15:49:48.173+0100\tINFO\truntime/asm_amd64.s:1598\tsuccess rate greater than threshold: 80\n2023-03-09T15:49:48.173+0100\tINFO\tcobra@v1.6.1/command.go:916\tjobs stopped\n2023-03-09T15:49:48.173+0100\tINFO\tcobra@v1.6.1/command.go:916\ttest passed\n```\n\nNetcat output showing the \"`examplemessage`\" received:\n\n```bash\nListening on localhost 12345\nConnection received on localhost 33226\nexamplemessage\nListening on localhost 12345\nConnection received on localhost 33228\nexamplemessage\nListening on localhost 12345\nConnection received on localhost 55004\nexamplemessage\nListening on localhost 12345\n```\n\n[testing_workflow_badge]: https://github.com/controlplaneio/netassertv2-l4-client/workflows/Lint%20and%20Build/badge.svg\n[release_workflow_badge]: https://github.com/controlplaneio/netassertv2-l4-client/workflows/Docker%20build%20and%20publish/badge.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontrolplaneio%2Fnetassertv2-l4-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontrolplaneio%2Fnetassertv2-l4-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontrolplaneio%2Fnetassertv2-l4-client/lists"}