{"id":21296452,"url":"https://github.com/mawngo/fastwebpush4j","last_synced_at":"2025-09-07T07:40:15.167Z","repository":{"id":249046154,"uuid":"823484369","full_name":"mawngo/fastwebpush4j","owner":"mawngo","description":"Optimized webpush library for java","archived":false,"fork":false,"pushed_at":"2025-07-14T17:04:35.000Z","size":106,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-14T21:31:25.712Z","etag":null,"topics":["java-library","webpush"],"latest_commit_sha":null,"homepage":"https://central.sonatype.com/artifact/io.github.mawngo/fastwebpush4j","language":"Java","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/mawngo.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":"2024-07-03T06:00:17.000Z","updated_at":"2025-07-14T16:55:52.000Z","dependencies_parsed_at":"2024-11-21T14:42:28.752Z","dependency_job_id":null,"html_url":"https://github.com/mawngo/fastwebpush4j","commit_stats":null,"previous_names":["mawngo/fastwebpush4j"],"tags_count":6,"template":false,"template_full_name":"mawngolibs/javalib-template","purl":"pkg:github/mawngo/fastwebpush4j","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mawngo%2Ffastwebpush4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mawngo%2Ffastwebpush4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mawngo%2Ffastwebpush4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mawngo%2Ffastwebpush4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mawngo","download_url":"https://codeload.github.com/mawngo/fastwebpush4j/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mawngo%2Ffastwebpush4j/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274010098,"owners_count":25206763,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["java-library","webpush"],"created_at":"2024-11-21T14:26:43.686Z","updated_at":"2025-09-07T07:40:15.127Z","avatar_url":"https://github.com/mawngo.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fast Webpush for Java\n\nImplement of VAPID webpush that sacrifice security and feature for raw speed.\n\nThis library use jetty client to send push for better http2 performance over java `HttpClient`, thus make the minimum\nsupported java version to be at least 17.\n\n## Installation\n\nRequire java 17+. For java 11 support: check [java11 branch](https://github.com/mawngo/fastwebpush4j/tree/java11)\n\nAdd library to gradle dependencies.\n\n```groovy\ndependencies {\n    implementation 'io.github.mawngo:fastwebpush4j:2.0.0'\n}\n```\n\n## Optimization\n\nThis library provides some optimizations that can be enabled when creating `VapidPusher`.\n\n- `vapidTokenTTL`: Caching vapid jwt token, and local public key + secret for each host. This optimization is enabled by\n  default and can be disabled by setting it to `0`.\n- `localSecretTTL`: Enable local public key and secret reuse. When enabled, the pusher\n  will reuse the local public key and secret if provided in `Subscription.LocalKey` otherwise it generates secret and\n  local public key to `Subscription.LocalKey`. We can save those cases for reuse for the later push to the same\n  `Subscription`.\n- `withRandom`: Allow to configure alternative `Random` implementation.\n\n## Example Usage\n\n```java\npackage io.github.mawngo.fastwebpush4j.example;\n\nimport io.github.mawngo.fastwebpush4j.Subscription;\nimport io.github.mawngo.fastwebpush4j.VapidPusher;\n\nimport java.util.concurrent.TimeUnit;\n\npublic class Main {\n    public static void main(String[] args) throws Exception {\n        // Preparation\n        final var privateKey = \"\u003cVAPID_PRIVATE_KEY\u003e\";\n        final var publicKey = \"\u003cVAPID_PUBLIC_KEY\u003e\";\n        final var sub = new Subscription(\n            \"\u003cSUB_ENDPOINT\u003e\",\n            new Subscription.Keys(\n                \"\u003cp256dh\u003e\",\n                \"\u003cauth\u003e\"\n            )\n        );\n\n        // Build the pusher.\n        final var pusher = VapidPusher.builder(\"example@example.com\", publicKey, privateKey)\n            .vapidTokenTTL(2, TimeUnit.HOURS)    // Configure vapid and local keypair cache time.\n            .localSecretTTL(10, TimeUnit.HOURS)  // Enable local public key and secret caching.\n            .build();\n\n        // Send the message.\n        final var res = pusher.prepareRequest(\"Test\".getBytes(), sub).send();\n        System.out.println(res.getStatus());\n        // Close after used.\n        pusher.close();\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmawngo%2Ffastwebpush4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmawngo%2Ffastwebpush4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmawngo%2Ffastwebpush4j/lists"}