{"id":21391338,"url":"https://github.com/ottomatica/waitssh","last_synced_at":"2025-03-16T13:22:07.914Z","repository":{"id":96005398,"uuid":"237453179","full_name":"ottomatica/waitssh","owner":"ottomatica","description":"⏱ Cross-platform utility to wait for ssh to become available","archived":false,"fork":false,"pushed_at":"2021-12-27T20:05:58.000Z","size":14,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-23T01:11:18.495Z","etag":null,"topics":["ssh"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/ottomatica.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-01-31T15:03:12.000Z","updated_at":"2021-12-27T20:06:00.000Z","dependencies_parsed_at":"2023-04-01T10:02:23.037Z","dependency_job_id":null,"html_url":"https://github.com/ottomatica/waitssh","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/ottomatica%2Fwaitssh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ottomatica%2Fwaitssh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ottomatica%2Fwaitssh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ottomatica%2Fwaitssh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ottomatica","download_url":"https://codeload.github.com/ottomatica/waitssh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243872610,"owners_count":20361517,"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":["ssh"],"created_at":"2024-11-22T13:25:59.666Z","updated_at":"2025-03-16T13:22:07.904Z","avatar_url":"https://github.com/ottomatica.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# waitssh\n\n`waitssh` is a cross-platform utility that waits for ssh to become available.\n\nOne common use case is for waiting for Virtual Machines to boot and waiting for sshd to be ready. Other tools, such as [wait-on](https://www.npmjs.com/package/wait-on) are agnostic to the network setup and will fail in cases such as port-forwarding.\n\n## Implementation\n\nHow does it work? `waitssh` implements the first phase of the SSH protocol specification, described in [RFC 4253](https://tools.ietf.org/html/rfc4253#section-4.2). Immediately after the TCP connection is established, and before negotiating the cryptography, both ends send an identification string:\n\n\u003e SSH-protoversion-softwareversion SP comments CR LF\n\n`waitssh` open a socket, attempts to write send a client version string to the ssh sever. `waitssh` gracefully handles `ECONNRESET` errors and reconnects as needed until the server responses with the appropriate version string.\n\n## Using waitssh\n\n`waitssh` does not need authentication information to verify the ssh connection being ready, only the hostname and port.\n\n```js\nconst waitssh = require('waitssh');\nlet sshInfo = {port: 2002, hostname: 'localhost'}\ntry {\n    await waitssh(sshInfo);\n} catch (error) {\n    console.error(error);\n    process.exit(1);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fottomatica%2Fwaitssh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fottomatica%2Fwaitssh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fottomatica%2Fwaitssh/lists"}