{"id":24539813,"url":"https://github.com/kerosene-labs/kindling","last_synced_at":"2025-04-15T06:25:43.473Z","repository":{"id":239975887,"uuid":"801147205","full_name":"Kerosene-Labs/kindling","owner":"Kerosene-Labs","description":"The fuel that'll ignite your application.  A programmable TLS HTTP/1.1 server with no dependencies.","archived":false,"fork":false,"pushed_at":"2024-12-05T00:39:25.000Z","size":22131,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T17:02:38.618Z","etag":null,"topics":["framework","java","lightweight","ssl","tls","web-server"],"latest_commit_sha":null,"homepage":"https://kerosenelabs.com/kindling","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/Kerosene-Labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-05-15T17:24:37.000Z","updated_at":"2025-02-25T12:39:22.000Z","dependencies_parsed_at":"2024-05-16T05:59:11.288Z","dependency_job_id":"add15827-1095-47f9-ac66-b785476a6f08","html_url":"https://github.com/Kerosene-Labs/kindling","commit_stats":null,"previous_names":["kerosene-labs/kindling"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kerosene-Labs%2Fkindling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kerosene-Labs%2Fkindling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kerosene-Labs%2Fkindling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kerosene-Labs%2Fkindling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kerosene-Labs","download_url":"https://codeload.github.com/Kerosene-Labs/kindling/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249018297,"owners_count":21199143,"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","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":["framework","java","lightweight","ssl","tls","web-server"],"created_at":"2025-01-22T17:16:23.468Z","updated_at":"2025-04-15T06:25:43.454Z","avatar_url":"https://github.com/Kerosene-Labs.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kindling\n\n*The fuel that'll ignite your application.*\n\nA programmable TLS HTTP/1.1 server written with no dependencies.\n\n## Key Features\n\n* SSL/TLS only (using `SSLServerSocket`)\n* No magic with visible control flow\n* Light weight\n* No Dependencies\n* Virtual Threads\n\n## Example\n\nBelow is an example implementation of a Kindling Server with a simple request handler that responds with a JSON object\nto a `GET` request on the `/` resource.\n\n```java\npublic class Main {\n    public static void main(String[] args) throws KindlingException {\n\n        KindlingServer server = KindlingServer.getInstance();\n\n        // test request handler\n        server.installRequestHandler(new RequestHandler() {\n            /**\n             * Tell the server what type of request this handler can work with\n             */\n            @Override\n            public boolean accepts(HttpRequest httpRequest) throws KindlingException {\n                return httpRequest.getHttpMethod().equals(HttpMethod.GET) \u0026\u0026 httpRequest.getResource().equals(\"/\");\n            }\n\n            /**\n             * Do your business logic here\n             */\n            @Override\n            public HttpResponse handle(HttpRequest httpRequest) throws KindlingException {\n                return new HttpResponse.Builder()\n                        .status(HttpStatus.OK)\n                        .contentType(MimeType.APPLICATION_JSON)\n                        .content(\"{\\\"key\\\": \\\"value\\\"}\")\n                        .build();\n            }\n        });\n\n        // serve our server\n        server.serve(8443, Path.of(\"keystore.p12\"), \"password\");\n    }\n}\n\n```\n\nLet's break down the components above.\n\n* KindlingServer\n  * The singleton that contains the application context\n  * Manages the `SSLServerSocket` and the virtual thread that is assigned to each request\n* RequestHandler\n  * Accepts\n    * Called when a request is received\n    * Return a boolean telling the server if we can handle this request\n  * Handle\n    * If the `accepts()` method returns true, `handle()` is called\n    * Do your business logic here, returning an `HttpResponse`\n* Server Serve\n  * Start serving the `SSLServerSocket` on the provided port with the given `P12` keystore\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkerosene-labs%2Fkindling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkerosene-labs%2Fkindling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkerosene-labs%2Fkindling/lists"}