{"id":39143854,"url":"https://github.com/dearplain/penet","last_synced_at":"2026-01-17T21:32:55.770Z","repository":{"id":57567464,"uuid":"320963325","full_name":"dearplain/penet","owner":"dearplain","description":"simple and reliable ARQ Protocol, used by dearplain/fast-shadowsocks","archived":false,"fork":false,"pushed_at":"2021-04-18T05:47:50.000Z","size":15,"stargazers_count":6,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-13T02:28:20.758Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dearplain.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}},"created_at":"2020-12-13T01:53:40.000Z","updated_at":"2024-09-11T15:29:33.000Z","dependencies_parsed_at":"2022-09-16T13:45:13.418Z","dependency_job_id":null,"html_url":"https://github.com/dearplain/penet","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/dearplain/penet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dearplain%2Fpenet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dearplain%2Fpenet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dearplain%2Fpenet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dearplain%2Fpenet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dearplain","download_url":"https://codeload.github.com/dearplain/penet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dearplain%2Fpenet/sbom","scorecard":{"id":330914,"data":{"date":"2025-08-11","repo":{"name":"github.com/dearplain/penet","commit":"bf100ebae0e1e0306752e985703aa09a27e13b1c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/5 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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"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-18T03:35:42.846Z","repository_id":57567464,"created_at":"2025-08-18T03:35:42.846Z","updated_at":"2025-08-18T03:35:42.846Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28518627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T18:55:29.170Z","status":"ssl_error","status_checked_at":"2026-01-17T18:55:03.375Z","response_time":85,"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":"2026-01-17T21:32:55.115Z","updated_at":"2026-01-17T21:32:55.722Z","avatar_url":"https://github.com/dearplain.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# penet\n\n## 协议头\n\n发送包\n\n| package type(1) | data type(1) | id(8) | body len(2) | seq(4) | timestamp(4) | wnd(4) | ... (real data) |\n|---|---|---|---|---|---|---|---|\n\n回复包\n\n| package type(1) | data type(1) | id(8) | body len(2) | timestamp(4) | wnd(4) | acked_seq(4) | ack seq1(4) | ack seq2 (4) | ... ack seq n (4) |\n|---|---|---|---|---|---|---|---|---|---|\n\n## 特点\n\n- 简单\n    - 协议简洁，代码易懂，方便用户修改。\n- 使用方便\n    - 提供golang net包类似的tcp接口，写、读接口是同步的。\n    - 阻塞式接口，不需要用户限制发送数据的速度。\n- 完整。比较完整模拟了tcp接口的行为\n    - 完整的生命周期管理，使用时候无需担心资源泄漏。网络异常等情况读写操作会返回错误。\n    - write完可以直接close，网络正常情况下，另一端可以收到所有数据。\n    - 对方关闭链接，也可以读完对方在关闭之前发送的所有数据，读完之后才会收到关闭消息。\n    - 支持无限长时间链接，不需要发送心跳包。\n    - 支持读超时。\n- cpu、内存消耗低\n    - 精心设计的代码，极大减少管道、协程、锁、timer、select的滥用。\n    - 没有链接时所有线程都处于阻塞状态，没有cpu消耗。\n    - 1W空转链接消耗2%的cpu(笔记本i5)。\n- 延迟低\n    - 没有握手包的延时。\n- 流量小\n    - 协议包头小，12byte，只占一般包大小的1/100。\n    - 已经ack的包不需要重发。\n    - ack包批量返回。\n    - 有基本的丢包限速功能。\n    - 对端不接受数据，不会频繁发送。\n\n## 注意事项\n\n- 默认的参数不一定适合所有人。penet.SetRate可以设置每秒发送的最大的字节。\n\n## 例子\n\n例子1：\n\n加速\u0026兼容各种手机端梯子：\n\n手机端科学上网软件(shadowsocks，比如Outline/SuperWingy/小火箭，tcp) --\u003e 国内转换服务器(tcp转penet) --\u003e 国外fast-shadowsocks服务器(penet)\n\n国内转换服务器代码：\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\n\t\"github.com/dearplain/penet\"\n)\n\n// ./utun -l :9086 -r xx.xx.xx.xx:xxx(远端fast-shadowsocks服务地址)\nfunc main() {\n\tvar local = flag.String(\"l\", \":8070\", \"local\")\n\tvar remote = flag.String(\"r\", \"\", \"remote\")\n\tflag.Parse()\n\tlistener, err := net.Listen(\"tcp\", *local)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\tfor {\n\t\tconn, err := listener.Accept()\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\treturn\n\t\t}\n\t\tgo func(localConn net.Conn) {\n\t\t\tremoteConn, err := penet.Dial(\"\", *remote)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tgo func() {\n\t\t\t\tio.Copy(localConn, remoteConn)\n\t\t\t\tremoteConn.Close()\n\t\t\t\tlocalConn.Close()\n\t\t\t}()\n\t\t\tio.Copy(remoteConn, localConn)\n\t\t\tremoteConn.Close()\n\t\t\tlocalConn.Close()\n\t\t}(conn)\n\t}\n}\n```\n\n## 测试\n\ntest/ben/ben.go 可测试\u0026验证顺序性、正确性和benmark速度。penet.SetRate调整速度，penet.SetDropRate调整丢包率。\n\n## TODO\n\n- [ ] 慢启动\n- [ ] 速度探测\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdearplain%2Fpenet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdearplain%2Fpenet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdearplain%2Fpenet/lists"}