{"id":13714070,"url":"https://github.com/leffss/gowebssh","last_synced_at":"2026-01-12T00:36:38.526Z","repository":{"id":47766366,"uuid":"244574735","full_name":"leffss/gowebssh","owner":"leffss","description":"Webssh implemented by github.com/gorilla/websocket and golang.org/x/crypto/ssh","archived":false,"fork":false,"pushed_at":"2025-02-11T09:04:16.000Z","size":1518,"stargazers_count":83,"open_issues_count":2,"forks_count":28,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T01:40:15.042Z","etag":null,"topics":["go","gowebssh","webssh"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/leffss.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,"zenodo":null}},"created_at":"2020-03-03T07:55:44.000Z","updated_at":"2025-02-11T09:04:19.000Z","dependencies_parsed_at":"2024-06-19T16:24:14.300Z","dependency_job_id":"fba294a5-7931-4802-9148-b4cc26e2391c","html_url":"https://github.com/leffss/gowebssh","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/leffss/gowebssh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leffss%2Fgowebssh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leffss%2Fgowebssh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leffss%2Fgowebssh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leffss%2Fgowebssh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leffss","download_url":"https://codeload.github.com/leffss/gowebssh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leffss%2Fgowebssh/sbom","scorecard":{"id":582988,"data":{"date":"2025-08-11","repo":{"name":"github.com/leffss/gowebssh","commit":"37f1446aaea2041269bac22ecd12528e853a3ee0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.1,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 1/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2021-0227 / GHSA-3vm4-22fp-5rfm","Warn: Project is vulnerable to: GO-2022-0968 / GHSA-gwc9-m7rh-j2ww","Warn: Project is vulnerable to: GO-2021-0356 / GHSA-8c26-wmh5-6g9v","Warn: Project is vulnerable to: GO-2024-2961","Warn: Project is vulnerable to: GO-2023-2402 / GHSA-45x7-px36-x8w8","Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T19:40:50.346Z","repository_id":47766366,"created_at":"2025-08-20T19:40:50.347Z","updated_at":"2025-08-20T19:40:50.347Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28329806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"ssl_error","status_checked_at":"2026-01-12T00:36:15.229Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["go","gowebssh","webssh"],"created_at":"2024-08-02T23:01:51.035Z","updated_at":"2026-01-12T00:36:38.494Z","avatar_url":"https://github.com/leffss.png","language":"JavaScript","funding_links":[],"categories":["Repositories"],"sub_categories":[],"readme":"# 说明\n\n\u003e English doc [README](./README_eng.md)\n\n\n\n使用 `github.com/gorilla/websocket` 与 `golang.org/x/crypto/ssh` 实现的 webssh，支持颜色以及自动补全\n\n参考：https://github.com/myml/webssh ，在原项目的基础上新增 publickey 登陆、zmodem 上传下载（支持禁用 sz 或者 rz）\n\n\n\n# 服务器端文档\n\n## 快速开始\n```go\n...\nimport (\n    ...\n\n    \"github.com/gorilla/websocket\"\n    \"github.com/leffss/gowebssh\"\n)\n...\nid := r.Header.Get(\"Sec-WebSocket-Key\")\nwebssh := gowebssh.NewWebSSH()\nwebssh.SetTerm(gowebssh.TermLinux)\nwebssh.SetBuffSize(8192)\nwebssh.SetId(id)\nwebssh.SetConnTimeOut(15 * time.Second)\nwebssh.DisableSZ()\n//webssh.DisableRZ()\n...\nupGrader := websocket.Upgrader{\n    CheckOrigin: func(r *http.Request) bool {\n        return true\n    },\n    //Subprotocols: []string{r.Header.Get(\"Sec-WebSocket-Protocol\")},\n    Subprotocols: []string{\"webssh\"},\n    ReadBufferSize: 8192,\n    WriteBufferSize: 8192,\n}\nws, _ := upGrader.Upgrade(w, r, nil)\nwebssh.AddWebsocket(ws)\n```\n\n\n\n# 客户端文档\n\n## 消息类型\n\n```go\ntype messageType string\n\nconst (\n\tmessageTypeAddr      = \"addr\"\n\tmessageTypeTerm      = \"term\"\n\tmessageTypeLogin     = \"login\"\n\tmessageTypePassword  = \"password\"\n\tmessageTypePublickey = \"publickey\"\n\tmessageTypeStdin     = \"stdin\"\n\tmessageTypeStdout    = \"stdout\"\n\tmessageTypeStderr    = \"stderr\"\n\tmessageTypeResize    = \"resize\"\n\tmessageTypeIgnore    = \"ignore\"\n\tmessageTypeConsole   = \"console\"\n)\n\ntype message struct {\n\tType messageType  `json:\"type\"`\n\tData []byte       `json:\"data,omitempty\"`\n\tCols int          `json:\"cols,omitempty\"`\n\tRows int          `json:\"rows,omitempty\"`\n}\n```\n\n\n\n## 消息协议\n\n1. 地址 `{type:\"addr\",data:\"$addr\"}`  \n   地址格式： ip:port，例如 192.168.223.111:22\n2. 登录 `{type:\"login\",data:\"$username\"}`\n3. 设置 term 终端类型 `{type:\"term\",data:\"$term\"}`    # 可不设置，默认 xterm\n4. 验证 `{type:\"password\",data:\"$password\"}` or `{type:\"publickey\",data:\"$publickey\",passphrase:\"$passphrase\"}`\n5. 窗口大小调整 `{type:\"resize\",cols:40,rows:80}`\n6. 忽略数据流 `{type:\"ignore\",data:\"$data\"}`     # 客户端发送到服务端，服务器忽略，可以用于 zmodem 文件传输记录\n7. console 数据流 `{type:\"console\",data:\"$data\"}`     # 服务端发送到客户端，客户端显示到 console 控制台的数据，\n可以用于 zmodem 文件传输时的 debug 信息\n8. alert 数据流 `{type:\"alert\",data:\"$data\"}`  # # 服务端发送到客户端的 alert 信息\n9. 标准流数据  \n   `{type:\"stdin\",data:\"$data\"}`\n   `{type:\"stdout\",data:\"$data\"}`\n   `{type:\"stderr\",data:\"$data\"}`  \n   客户端发送 stdin, 接收 stdout, stderr\n\n\n\n## Data 数据\n\n消息的 data 数据使用 base64 编码传输，JavaScript 的`atob \u0026 btoa`可用于 base64 编码，但对 utf8 有兼容性问题，\n要使用`decodeURIComponent \u0026 encodeURIComponent`做包裹, 以下是实现\n\n```javascript\nfunction utf8_to_b64(rawString) {\n  return btoa(unescape(encodeURIComponent(rawString)));\n}\n\nfunction b64_to_utf8(encodeString) {\n  return decodeURIComponent(escape(atob(encodeString)));\n}\n```\n\n\n\n# 实例\n\n具体实例参考 `example` 文件夹\n\n\n\n# 预览\n\n![效果](https://github.com/leffss/gowebssh/blob/master/screenshots/1.PNG?raw=true)\n![效果](https://github.com/leffss/gowebssh/blob/master/screenshots/2.PNG?raw=true)\n![效果](https://github.com/leffss/gowebssh/blob/master/screenshots/3.PNG?raw=true)\n![效果](https://github.com/leffss/gowebssh/blob/master/screenshots/4.PNG?raw=true)\n![效果](https://github.com/leffss/gowebssh/blob/master/screenshots/5.PNG?raw=true)\n![效果](https://github.com/leffss/gowebssh/blob/master/screenshots/6.PNG?raw=true)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleffss%2Fgowebssh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleffss%2Fgowebssh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleffss%2Fgowebssh/lists"}