{"id":15373001,"url":"https://github.com/vi/stdintap","last_synced_at":"2025-04-15T14:13:34.104Z","repository":{"id":251424895,"uuid":"837377581","full_name":"vi/stdintap","owner":"vi","description":"Command line tool to accept logs from stdin and allow \"tapping\" (i.e. subscribing) to them using sockets.","archived":false,"fork":false,"pushed_at":"2024-08-02T22:35:32.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T14:13:29.247Z","etag":null,"topics":["command-line-tool","logging","socket","stdin","stdio","tcp-server","text-utility","unix-socket"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-08-02T20:38:44.000Z","updated_at":"2024-10-23T21:18:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"1da3c91b-6b66-4d01-bb40-4a3cced4a639","html_url":"https://github.com/vi/stdintap","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"3d7c491e5e9c67cc53886785b072289e1da7eab2"},"previous_names":["vi/stdintap"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fstdintap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fstdintap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fstdintap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fstdintap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vi","download_url":"https://codeload.github.com/vi/stdintap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249085429,"owners_count":21210267,"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":["command-line-tool","logging","socket","stdin","stdio","tcp-server","text-utility","unix-socket"],"created_at":"2024-10-01T13:54:00.049Z","updated_at":"2025-04-15T14:13:34.077Z","avatar_url":"https://github.com/vi.png","language":"Rust","readme":"# stdintap\n\nRead lines from stdin and copy them to all connected clients.\n\n## Features\n\n* UNIX socket support (including Linux's abstract namespace)\n* Adjustable behaviour of handling slow clients: lines may be dropped or backpressure can be applied.\n* For slow clients, `stdintap` can announce number of omitted lines. Alternatively, it can announce moments where backpressure was applied.\n* History mode - `stdintap` can keep N last lines and replay them to connected clients. There is optional announcement where history ends and realtime data begins.\n* Optional printing of timestamps (using monotonic timer) and sequence numbers.\n* Maximum line size is limited (adjustable). You can use zero byte instead of newline if needed.\n* You can request content to be also forwarded to stdout.\n* Reasonable performance.\n\n## Examples\n\nSimple\n\n```\n| $ stdintap 127.0.0.1:1234\n| A\n| B\n| C    | $ nc 127.0.0.1 1234\n| D    | D\n| E    | E\n| F    | F    | $ nc 127.0.0.1 1234\n| G    | G    | G\n| H    | ^C   | H\n| I    | $    | I\n| J           | J\n...\n```\n\nAdvanced options\n\n```\n| $ stdintap @qqq -x -H --history 2 -t --seqn\n| a\n| b\n| c\n| d\n| e   \n|     | $ socat - abstract:qqq\n|     | 000004.000452   3       d\n|     | 000006.000780   4       e\n|     | 000012.000967 HELLO\n| f   | 000085.000356   5       f\n| g   | 000090.000084   6       g\n| ^D  | 000134.000408 EOF\n| $   | $\n```\n\n\u003cdetails\u003e\u003csummary\u003e Overrun announcements \u003c/summary\u003e\n\n```\n| $ stdintap @qqq -x --qlen 1 --send-buffer-size 16\n|                   | $ socat - abstract:qqq,rcvbuf=16\n| 000000000000000   | 000000000000000\n| 111111111111111   | 111111111111111\n| 222222222222222   | 222222222222222\n|                   | ^Z\n|                   | [1]+  Stopped\n|                   | $\n| 333333333333333\n| 444444444444444\n| 555555555555555\n| 666666666666666\n| 777777777777777\n| 888888888888888\n| 999999999999999\n| AAAAAAAAAAAAAAA\n| BBBBBBBBBBBBBBB\n| CCCCCCCCCCCCCCC\n| DDDDDDDDDDDDDDD\n| EEEEEEEEEEEEEEE\n| FFFFFFFFFFFFFFF\n| GGGGGGGGGGGGGGG\n|                   | $ fg\n|                   | 333333333333333\n|                   | 444444444444444\n|                   | 555555555555555\n|                   | 666666666666666\n|                   | 777777777777777\n|                   | 888888888888888\n|                   | 999999999999999\n|                   | AAAAAAAAAAAAAAA\n|                   | OVERRUN 5\n|                   | GGGGGGGGGGGGGGG\n| HHHHHHHHHHHHHHH   | HHHHHHHHHHHHHHH\n| ^D                | EOF\n| $                 | $\n```\n\n\u003c/details\u003e\n\n## Installation\n\nDownload a pre-built executable from [Github releases](https://github.com/vi/stdintap/releases) or install from source code with `cargo install --path .`  or `cargo install stdintap`.\n\n## CLI options\n\n\u003cdetails\u003e\u003csummary\u003e stdintap --help output (not including the `tokio-listener` options)\u003c/summary\u003e\n\n```\nCLI tool to read lines from stdin and broadcast them to connected TCP clients\n\nUsage: \n\nArguments:\n  \u003cLISTEN_ADDRESS\u003e\n          Socket address to listen for incoming connections.\n          \n          Various types of addresses are supported:\n          \n          * TCP socket address and port, like 127.0.0.1:8080 or [::]:80\n          \n          * UNIX socket path like /tmp/mysock or Linux abstract address like @abstract\n          \n          * Special keyword \"sd-listen\" to accept connections from file descriptor 3 (e.g. systemd socket activation). You can also specify a named descriptor after a colon or * to use all passed sockets.\n          \n          Note that some features may be disabled by compile-time settings.\n\nOptions:\n  -q, --qlen \u003cQLEN\u003e\n          Size of broadcast channel for serving the lines\n          \n          [default: 16]\n\n      --backpressure\n          Slow down reading from stdin if connected clients are slow in reading output\n\n  -x, --announce-overruns\n          Inject special lines that denote missed content due to slow reading In `--backpressure` mode, it will insert announcements that backpressure is applied Additionally, stdin EOFs will also be announced.\n          \n          When `--timestamps` are active, special lines are separated from the timestamp by spaces instead of tabs.\n          \n          Note that overrun announcements may exacerbate overruns.\n\n      --disconnect-on-overruns\n          Disconnect clients when they are too slow to read lines\n\n  -t, --timestamps\n          Prefix messages with a monotone timestamps\n\n  -H, --hello-message\n          Inject initial message at the beginning of each client connection\n          \n          With --history option, the hello message appears after the history, before the \"online\" content.\n\n      --max-line-size \u003cMAX_LINE_SIZE\u003e\n          Automatically split lines longer than this\n          \n          [default: 65536]\n\n  -0, --zero-separated\n          Separata lines by zero byte instead of \\n\n\n  -T, --tee\n          Also copy stdin to stdout\n\n      --seqn\n          Print sequence numbers of lines\n\n      --history \u003cHISTORY\u003e\n          Remember and this number of lines and replay them to each connecting client\n\n      --require-observer\n          Don't read from stdin unless at least one client is connected.\n          \n          Does not gurantee lack of dropped lines on disconnections.\n\n  -h, --help\n          Print help (see a summary with '-h')\n\n  -V, --version\n          Print version\n\n```\n\n(manually removed an inapplicable phrase)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e Socket listening options \u003c/summary\u003e\n\n```\n      --unix-listen-unlink\n          remove UNIX socket prior to binding to it\n\n      --unix-listen-chmod \u003cUNIX_LISTEN_CHMOD\u003e\n          change filesystem mode of the newly bound UNIX socket to `owner`, `group` or `everybody`\n\n      --unix-listen-uid \u003cUNIX_LISTEN_UID\u003e\n          change owner user of the newly bound UNIX socket to this numeric uid\n\n      --unix-listen-gid \u003cUNIX_LISTEN_GID\u003e\n          change owner group of the newly bound UNIX socket to this numeric uid\n\n      --sd-accept-ignore-environment\n          ignore environment variables like LISTEN_PID or LISTEN_FDS and unconditionally use file descritor `3` as a socket in sd-listen or sd-listen-unix modes\n\n      --tcp-keepalive \u003cTCP_KEEPALIVE\u003e\n          set SO_KEEPALIVE settings for each accepted TCP connection.\n          \n          Value is a colon-separated triplet of time_ms:count:interval_ms, each of which is optional.\n\n      --tcp-reuse-port\n          Try to set SO_REUSEPORT, so that multiple processes can accept connections from the same port in a round-robin fashion\n\n      --recv-buffer-size \u003cRECV_BUFFER_SIZE\u003e\n          Set socket's SO_RCVBUF value\n\n      --send-buffer-size \u003cSEND_BUFFER_SIZE\u003e\n          Set socket's SO_SNDBUF value\n\n      --tcp-only-v6\n          Set socket's IPV6_V6ONLY to true, to avoid receiving IPv4 connections on IPv6 socket\n\n      --tcp-listen-backlog \u003cTCP_LISTEN_BACKLOG\u003e\n          Maximum number of pending unaccepted connections\n```\n\n\n\u003c/details\u003e\n\n## See also\n\n* https://github.com/vi/line2httppost + https://github.com/vi/postsse\n* https://github.com/vi/websocat + https://github.com/vi/wsbroad\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvi%2Fstdintap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvi%2Fstdintap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvi%2Fstdintap/lists"}