{"id":15159285,"url":"https://github.com/snchengqi/http2-qing","last_synced_at":"2026-02-19T10:04:59.375Z","repository":{"id":57722866,"uuid":"275517333","full_name":"snchengqi/http2-qing","owner":"snchengqi","description":"A library for http2 protocol based on netty","archived":false,"fork":false,"pushed_at":"2023-07-23T21:29:05.000Z","size":105,"stargazers_count":22,"open_issues_count":2,"forks_count":1,"subscribers_count":7,"default_branch":"1.0.0","last_synced_at":"2025-08-01T19:27:09.335Z","etag":null,"topics":["http2","java","maven","netty","server-push"],"latest_commit_sha":null,"homepage":"","language":"Java","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/snchengqi.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-06-28T05:55:06.000Z","updated_at":"2024-06-05T04:10:33.000Z","dependencies_parsed_at":"2024-09-22T08:00:44.172Z","dependency_job_id":null,"html_url":"https://github.com/snchengqi/http2-qing","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/snchengqi/http2-qing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snchengqi%2Fhttp2-qing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snchengqi%2Fhttp2-qing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snchengqi%2Fhttp2-qing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snchengqi%2Fhttp2-qing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snchengqi","download_url":"https://codeload.github.com/snchengqi/http2-qing/tar.gz/refs/heads/1.0.0","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snchengqi%2Fhttp2-qing/sbom","scorecard":{"id":834404,"data":{"date":"2025-08-11","repo":{"name":"github.com/snchengqi/http2-qing","commit":"7c81bb3dfa452a5775e6cf82958e809a83f942c4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"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":"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":"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":"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 0/14 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":"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":"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":"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":"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: Apache License 2.0: 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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-5mg8-w23w-74h3","Warn: Project is vulnerable to: GHSA-7g45-4rm6-3mm3","Warn: Project is vulnerable to: GHSA-269g-pwp5-87pp","Warn: Project is vulnerable to: GHSA-g6ph-x5wf-g337","Warn: Project is vulnerable to: GHSA-jcwr-x25h-x5fh"],"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-23T18:35:18.951Z","repository_id":57722866,"created_at":"2025-08-23T18:35:18.951Z","updated_at":"2025-08-23T18:35:18.951Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29609531,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T06:47:36.664Z","status":"ssl_error","status_checked_at":"2026-02-19T06:45:47.551Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["http2","java","maven","netty","server-push"],"created_at":"2024-09-26T21:02:33.957Z","updated_at":"2026-02-19T10:04:59.357Z","avatar_url":"https://github.com/snchengqi.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# http2-qing\nhttp2-qing is a library for http2 protocol based on netty\n\n[中文文档](https://github.com/snchengqi/http2-qing/blob/1.0.0/README_zh.md)\n\n![](https://img.shields.io/badge/license-Apache2-000000.svg)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/snchengqi/http2-qing)\n\n## Features\n\n- Develop based on netty,with good performance\n- Encapsulate the http2 protocol and provide simple and easy-to-use APIs\n- Basically all asynchronous methods\n- Support manage connections of server and server-push\n- Provides client disconnection and reconnection and support customized reconnect policy\n\n## How  to use\n\n### program  codes  for  server\n\nFirstly, import maven dependency about http2-server to your project\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.snchengqi\u003c/groupId\u003e\n  \u003cartifactId\u003ehttp2-qing-server\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nConstruct the environment of server, and config necessary options. Firstly, you need to new a Environment4Server object, and then set propeties such as port,ConnectionManager,RequestHandler, as follows excample\n\n```java\nSimpleConnectionManager connectionManager = new SimpleConnectionManager();\nEnvironment4Server env = new Environment4Server();\nenv.setPort(8080).setConnectionManager(connectionManager).setRequestHandler(context -\u003e {\n    if (context.isSuccess()) {\n        ConnectionFacade connection = context.connection();\n        Http2Stream stream = context.stream();\n        HttpRequest request = context.request();\n        String responseMessage = \"server response for client request\";\n        System.out.println(\"=============================\");\n        System.out.println(\"time:\" + new Date());\n        System.out.println(\"server receive client request message:\" + new String(request.getBody()));\n        System.out.println(\"stream id:\" + stream.id());\n        System.out.println(\"server send response message:\" + responseMessage);\n        System.out.println(\"=============================\");\n\n        HttpResponse response = new HttpResponse(EmptyHttp2Headers.INSTANCE, responseMessage.getBytes());\n        connection.sendResponse(response, stream.id());\n        return;\n    }\n    context.cause().printStackTrace();\n});\n```\n\nUsing Http2ServerFactoryBuilder to build the object which is a factory method object of Http2Server, so you can create a Http2Server Object, then start the server\n\n```java\nHttp2ServerFactory factory = new Http2ServerFactoryBuilder(env).build();\nHttp2Server server = factory.createServer();\nCompletableFuture\u003cVoid\u003e bindFuture = server.start();\nbindFuture.get();\n```\n\nAnd then, could get the connection by connectionManager  which you defined, and send server-push to remote endpoint, for example, like this\n\n```java\nconnectionManager.forEach(connection -\u003e {\n    CompletableFuture\u003cHttpPushAck\u003e future = connection.sendPushMessage(new HttpPushEntity(EmptyHttp2Headers.INSTANCE,pushMessage.getBytes()));\n    future.whenComplete((r, cause) -\u003e {\n        if (cause == null) {\n            System.out.println(\"=============================\");\n            System.out.println(\"time:\" + new Date());\n            System.out.println(\"server send push message:\" + pushMessage);\n            System.out.println(\"receive client ack:\" + new String(r.getBody()));\n            System.out.println(\"=============================\");\n            return;\n        }\n        cause.printStackTrace();\n    });\n};\n```\n\nFinally, don`t forget close the Http2Server to release resources\n\n```java\nserver.close();\n```\n\n### program  code  for   client\n\nFirstly, import maven dependency about http2-client to your project\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.snchengqi\u003c/groupId\u003e\n  \u003cartifactId\u003ehttp2-qing-client\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nConstruct the environment of client, and config necessary options. Firstly, you need to new a Environment4Client object, and then set propeties such as remote ip and port,ServerPushHandler, as follows excample\n\n```java\nEnvironment4Client env = new Environment4Client();\nenv.setIp(\"127.0.0.1\").setPort(8080).setServerPushHandler(context -\u003e {\n    if (context.isSuccess()) {\n        Http2Client client = context.client();\n        HttpPushEntity pushEntity = context.pushEntity();\n        Http2Stream stream = context.stream();\n        String ackMessage = \"client ack for server push\";\n        System.out.println(\"=============================\");\n        System.out.println(\"time:\" + new Date());\n        System.out.println(\"client receive server push:\" + (pushEntity.getBody() == null? \"null\": new String(pushEntity.getBody())));\n        System.out.println(\"stream id:\" + stream.id());\n        System.out.println(\"client ack message:\" + ackMessage);\n        System.out.println(\"=============================\");\n\n        HttpPushAck ack = new HttpPushAck(EmptyHttp2Headers.INSTANCE, ackMessage.getBytes());\n        client.sendPushAck(ack, stream.id());\n        return;\n    }\n    context.cause().printStackTrace();\n});\n```\n\nUsing Http2ClientFactoryBuilder to build the object which is a factory method object of Http2Client, so you can create a Http2Client Object, then start it to connect to remote server\n\n```java\nHttp2ClientFactory factory = new Http2ClientFactoryBuilder(env).build();\nHttp2Client client = factory.createClient();\nCompletableFuture\u003cVoid\u003e connectFuture = client.connect();\nconnectFuture.get();\n```\n\nAfter connected to server, you can user the client to send a request and receive response asynchronously\n\n```java\nString requestContent = \"request message of client\";\nHttpRequest request = new HttpRequest(EmptyHttp2Headers.INSTANCE, requestContent.getBytes());\nCompletableFuture\u003cHttpResponse\u003e requestFuture = client.sendRequest(request);\nrequestFuture.whenComplete((r, cause) -\u003e {\n    if (cause == null) {\n        System.out.println(\"=============================\");\n        System.out.println(\"time:\" + new Date());\n        System.out.println(\"client send request message:\" + requestContent);\n        System.out.println(\"receive server response:\" + new String(r.getBody()));\n        System.out.println(\"=============================\");\n        return;\n    }\n    cause.printStackTrace();\n});\n```\n\nFinally，remember to close the client \n\n```java\nclient.close();\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnchengqi%2Fhttp2-qing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnchengqi%2Fhttp2-qing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnchengqi%2Fhttp2-qing/lists"}