{"id":33179360,"url":"https://github.com/94fzb/simplewebserver","last_synced_at":"2026-01-16T06:36:17.313Z","repository":{"id":57724994,"uuid":"42981956","full_name":"94fzb/simplewebserver","owner":"94fzb","description":"SimpleWebServer 是一款使用Java基于NIO编写的超轻量级开源Web Application Server","archived":false,"fork":false,"pushed_at":"2025-12-22T06:57:30.000Z","size":1040,"stargazers_count":92,"open_issues_count":1,"forks_count":24,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-12-23T18:12:42.232Z","etag":null,"topics":["java","nio","simplewebserver","webserver"],"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/94fzb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-09-23T06:13:47.000Z","updated_at":"2025-12-22T06:57:34.000Z","dependencies_parsed_at":"2023-11-26T08:27:07.264Z","dependency_job_id":"3c758b24-b04a-48db-b9e2-8efe1c3f7992","html_url":"https://github.com/94fzb/simplewebserver","commit_stats":null,"previous_names":[],"tags_count":350,"template":false,"template_full_name":null,"purl":"pkg:github/94fzb/simplewebserver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/94fzb%2Fsimplewebserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/94fzb%2Fsimplewebserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/94fzb%2Fsimplewebserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/94fzb%2Fsimplewebserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/94fzb","download_url":"https://codeload.github.com/94fzb/simplewebserver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/94fzb%2Fsimplewebserver/sbom","scorecard":{"id":6268,"data":{"date":"2025-08-11","repo":{"name":"github.com/94fzb/simplewebserver","commit":"10f4da280ef0ac4ebec80a06ca4e288234921cb9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.7,"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":10,"reason":"no dangerous workflow patterns detected","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":"Maintained","score":10,"reason":"30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/deploy-to-ossrh.yml:1","Info: no jobLevel write permissions found"],"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy-to-ossrh.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/94fzb/simplewebserver/deploy-to-ossrh.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy-to-ossrh.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/94fzb/simplewebserver/deploy-to-ossrh.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"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: 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":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"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/deploy-to-ossrh.yml:9"],"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"}}]},"last_synced_at":"2025-08-14T13:37:16.043Z","repository_id":57724994,"created_at":"2025-08-14T13:37:16.043Z","updated_at":"2025-08-14T13:37:16.043Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"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":["java","nio","simplewebserver","webserver"],"created_at":"2025-11-16T03:00:36.830Z","updated_at":"2026-01-16T06:36:17.305Z","avatar_url":"https://github.com/94fzb.png","language":"Java","readme":"# SimpleWebServer\n\n[![Maven Central](https://img.shields.io/maven-central/v/com.hibegin/simplewebserver.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/com.hibegin/simplewebserver)\n\n\u003e SimpleWebServer 是一款使用Java基于NIO编写的超轻量级开源Web Application Server\n\n是否遇到有时候想做一些小的Web程序，但是迫于Java运行环境过于繁琐而迟迟没有下手，那么现在除了SpringBoot，广大的Java程序员又多了一个选择\n\n### 轻量级\n\n并不基于servlet，源代码仅3000行左右，jar包仅 0.1m 左右，零依赖，无xml，极低的内存占用，所以不用担心程序能不能在嵌入式（树莓派）/Android\n上能否正常运行\n\n### 完整\n\n```\n基本常用API都有，还是熟悉的配方，熟悉的味道，web程序编写更容易\n```\n\n- Request\n- Response\n- Controller\n- Cookie/Session\n- Interceptor\n- Json\n- Freemarker 模板\n- 文件上传\n- GZip\n- 静态文件服务器\n\n### GraalVM Native\n\nJava21 loom + GraalVM Native 让应用有更小的内存占用和更快捷的运行体验\n\n在使用 Native 后，单个可执行文件大概 15mb 左右，通过 zip 后程序在 5m 左右，足够小（对比完整 JDK）\n\n### SimpleWebServer-Cli\n\n快速体验：https://github.com/94fzb/simplewebserver-cli\n\n基于 simplewebserver，使用 GraalVM Native Image，提供一个简单文件服务分享服务（无需 Java环境）\n\n类似 python 的一行代码启动一个基于 http 的文件服务，比 python 更简单，无需 pip\n\n### 快速上手\n\n#### Java 版本\n\n- 必须： Java8 及以上版本，\n- 推荐： Java11 及以上的版本\n\n```xml\n\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.hibegin\u003c/groupId\u003e\n    \u003cartifactId\u003esimplewebserver\u003c/artifactId\u003e\n    \u003cversion\u003e4.0.107\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n```java\npublic class DemoController extends Controller {\n\n    public static void main(String[] args) {\n        ServerConfig serverConfig = new ServerConfig();\n        serverConfig.getRouter().addMapper(\"\", DemoController.class);\n        new WebServerBuilder.Builder().serverConfig(serverConfig).build().startWithThread();\n    }\n\n    public void index() {\n        getResponse().renderText(\"Hello world/v\" + ServerInfo.getVersion());\n    }\n}\n```\n\n然后浏览器输入 http://localhost:6058\n\n### 打包\n\n**推荐使用 maven-assembly-plugin**\n\n```xml\n\n\u003cbuild\u003e\n    \u003cplugins\u003e\n        \u003cplugin\u003e\n            \u003cartifactId\u003emaven-assembly-plugin\u003c/artifactId\u003e\n            \u003cversion\u003e2.5.5\u003c/version\u003e\n            \u003cconfiguration\u003e\n                \u003carchive\u003e\n                    \u003cmanifest\u003e\n                        \u003cmainClass\u003ecom.hibegin.http.server.test.DemoController\u003c/mainClass\u003e\n                    \u003c/manifest\u003e\n                \u003c/archive\u003e\n                \u003cfinalName\u003esimplewebserver-demo\u003c/finalName\u003e\n                \u003cdescriptorRefs\u003e\n                    \u003cdescriptorRef\u003ejar-with-dependencies\u003c/descriptorRef\u003e\n                \u003c/descriptorRefs\u003e\n            \u003c/configuration\u003e\n        \u003c/plugin\u003e\n    \u003c/plugins\u003e\n\u003c/build\u003e\n```\n\n`mvn clean compile assembly:single`\n\n### 性能\n\n简单与号称 “性能打爆网卡的tio” 对比，感兴趣移步到 https://gitee.com/94fzb/simplewebserver-performance\n\n## Changelog\n\n[完整的版本变化日志](CHANGELOG.md)\n\n## TODO\n\n- 支持HTTP2.0基本协议（不包含服务端推送）\n- ~~实现多线程解码HTTP请求~~\n- 提供类似 SpringMVC 通过注解完成 Restful API的编写\n- ~~提供多种 JSON 序列化工具包支持~~\n- ~~提供HTTP错误码错误页面配置功能~~\n\n## 其他\n\n* WebServer 默认端口为 `6058` 在 `conf/conf.properties` 中，或则通过代码的方式进行配置\n* 使用 `FreeMarkerKit.init` 初始化模板文件根目录，`FreeMarkerKit.initClassTemplate` 初始模板相对jar中的根目录\n* 服务器上时建议打包为 `jar` 文件运行（推荐使用 maven，jar文件路径与`conf` 文件夹同目录）\n* 依赖的json和freemarker的jar都是非必须\n\n## License\n\nSimpleWebServer is Open Source software released under\nthe [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html).\n","funding_links":[],"categories":["网络编程"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F94fzb%2Fsimplewebserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F94fzb%2Fsimplewebserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F94fzb%2Fsimplewebserver/lists"}