{"id":39764172,"url":"https://github.com/truexf/iip","last_synced_at":"2026-01-18T11:43:33.927Z","repository":{"id":57617554,"uuid":"383331175","full_name":"truexf/iip","owner":"truexf","description":"基于TCP的多路复用的基础通讯协议及框架(IIP,Internal Interaction Protocol),该协议可作为RPC接口调用的底层协议，如同http2之于gRPC，本项目基于该协议实现了client/server的基础框架。","archived":false,"fork":false,"pushed_at":"2023-04-10T09:51:37.000Z","size":4040,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T13:33:54.743Z","etag":null,"topics":["client-server","golang","high-performance","http","multiplexing","protocol","rpc","server","tcp"],"latest_commit_sha":null,"homepage":"","language":"Go","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/truexf.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":"2021-07-06T03:45:30.000Z","updated_at":"2023-04-29T17:07:06.000Z","dependencies_parsed_at":"2024-06-20T13:02:30.279Z","dependency_job_id":"b572c28a-13e1-4c1b-acc3-ac8d02e3ab6c","html_url":"https://github.com/truexf/iip","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/truexf/iip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truexf%2Fiip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truexf%2Fiip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truexf%2Fiip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truexf%2Fiip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/truexf","download_url":"https://codeload.github.com/truexf/iip/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truexf%2Fiip/sbom","scorecard":{"id":899796,"data":{"date":"2025-08-11","repo":{"name":"github.com/truexf/iip","commit":"8ee6128dbac7152054bd4927ee59ede368e14664"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"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":"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":"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":"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":"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":"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":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":"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-24T15:08:19.462Z","repository_id":57617554,"created_at":"2025-08-24T15:08:19.462Z","updated_at":"2025-08-24T15:08:19.462Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28535177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T10:13:46.436Z","status":"ssl_error","status_checked_at":"2026-01-18T10:13:11.045Z","response_time":98,"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":["client-server","golang","high-performance","http","multiplexing","protocol","rpc","server","tcp"],"created_at":"2026-01-18T11:43:33.832Z","updated_at":"2026-01-18T11:43:33.900Z","avatar_url":"https://github.com/truexf.png","language":"Go","readme":"[![GoDoc](https://godoc.org/github.com/truexf/iip?status.svg)](http://godoc.org/github.com/truexf/iip) \n\n## IIP是什么？ \n基于TCP的多路复用的基础通讯协议及框架(IIP,Internal Interaction Protocol),该协议可作为RPC接口调用的底层协议，如同http2之于gRPC，本项目基于该协议实现了client/server的基础框架。\n\n## 使用说明\n* echo回显client示例: [example/echo_client/echo_client.go](https://github.com/truexf/iip/blob/master/example/echo_client/echo_client.go)\n* echo回显server示例: [example/echo_server/echo_server.go](https://github.com/truexf/iip/blob/master/example/echo_server/echo_server.go)\n* 文件下载client示例(支持断点续传): [example/file_client/file_client.go](https://github.com/truexf/iip/blob/master/example/file_client/file_client.go)\n* 文件下载server示例(支持断点续传): [example/file_server/file_server.go](https://github.com/truexf/iip/blob/master/example/file_server/file_server.go)\n* 文件上传client示例(支持断点续传): [example/upload_client/upload_client.go](https://github.com/truexf/iip/blob/master/example/upload_client/upload_client.go)\n* 文件上传server示例(支持断点续传): [example/upload_server/upload_server.go](https://github.com/truexf/iip/blob/master/example/upload_server/upload_server.go)\n* load-balance-client高并发请求示例: [loadbalanceclient_test.go](https://github.com/truexf/iip/blob/master/loadbalanceclient_test.go)\n* httpClient\u003c==\u003ehttpServer(作为反向代理)\u003c==\u003eiipServer [httpadapter/http_server_test.go](https://github.com/truexf/iip/blob/master/httpadapter/http_server_test.go)\n\n## benchmark对比测试\n* BenchmarkPFEchoClientServer: 普通iip client单个channel\n* BenchmarkPFEchoNetHttp：标准库 net/http \n* BenchmarkPFIIPBalanceClient：iip load balance client  \n* 运行benchmark前需要先编译运行启动server端，server代码在example/echo_server/  编译：$ go build ./echo_server.go  启动: $ ./echo_server\n* 单核：\n```\n$ GOMAXPROCS=1 go test -bench=. -naddr=\"192.168.2.98:9091\" -lbcaddr=\"192.168.2.98:9090#2\" -iipaddr=\"192.168.2.98:9090\" -run=\"PF.*\" -benchmem -benchtime=10s\nBenchmarkPFEchoClientServer \t    5418\t   1944837 ns/op\t   99428 B/op\t      16 allocs/op\nBenchmarkPFEchoNetHttp      \t    3510\t   3342903 ns/op\t   51476 B/op\t      64 allocs/op\nBenchmarkPFIIPBalanceClient \t    6043\t   1942451 ns/op\t   92033 B/op\t      16 allocs/op\n```\n\n* 四核:\n```\n$ GOMAXPROCS=4 go test -bench=. -naddr=\"192.168.2.98:9091\" -lbcaddr=\"192.168.2.98:9090#2\" -iipaddr=\"192.168.2.98:9090\" -run=\"PF.*\" -benchmem -benchtime=10s\nBenchmarkPFEchoClientServer-4   \t    7243\t   1589468 ns/op\t   99418 B/op\t      16 allocs/op\nBenchmarkPFEchoNetHttp-4        \t   13854\t    868070 ns/op\t   51576 B/op\t      64 allocs/op\nBenchmarkPFIIPBalanceClient-4   \t   19844\t    590167 ns/op\t   85720 B/op\t      15 allocs/op\n```\n\n* 八核:\n```\n$ GOMAXPROCS=8 go test -bench=. -naddr=\"192.168.2.98:9091\" -lbcaddr=\"192.168.2.98:9090#2\" -iipaddr=\"192.168.2.98:9090\" -run=\"PF.*\" -benchmem -benchtime=10s\nBenchmarkPFEchoClientServer-8   \t    7090\t   1630507 ns/op\t   99443 B/op\t      16 allocs/op\nBenchmarkPFEchoNetHttp-8        \t   27556\t    428245 ns/op\t   52198 B/op\t      65 allocs/op\nBenchmarkPFIIPBalanceClient-8   \t   36670\t    305865 ns/op\t   84436 B/op\t      15 allocs/op\n```\n\n## 典型案例 \n一个靠谱的底层通讯框架组件，必然是基于一个真实生产系统，伴随着该系统的成长迭代，历史思考和实践基础上抽象发展而成。\n\n ![image](https://github.com/truexf/iip/blob/master/usecase/baixun.png)  \n[百寻广告流量交易平台](https://www.adxliangmei.com/)日处理数十亿次广告流量请求,峰值qps 4w+, 采用iip承载其内部核心交易系统的微服务。\n\n## IIP架构 \n ![image](https://github.com/truexf/iip/blob/master/iip.jpg)  \n\n\n## IIP帧格式：\n ![image](https://github.com/truexf/iip/blob/master/packet.jpg)  \n   \n\n\n### * 对于协议的扩展性考虑，按分层的思想，可以在上层通过对数据字段进行进一步的协议定义来满足，本协议保持简单性，不提供额外的冗余扩展字段。\n比如示例中的文件下载，每次请求响应传输文件的其中一块，文件的整体组合由一个简单的上层协议实现。\n\n\n\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftruexf%2Fiip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftruexf%2Fiip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftruexf%2Fiip/lists"}