{"id":23602836,"url":"https://github.com/lzwme/static-server","last_synced_at":"2026-03-10T16:13:13.089Z","repository":{"id":41390885,"uuid":"385136182","full_name":"lzwme/static-server","owner":"lzwme","description":"一个基于 nodejs 的简易静态服务器，方便随时开发调试使用。支持简单的 PHP 服务。","archived":false,"fork":false,"pushed_at":"2025-11-04T10:39:34.000Z","size":98,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-04T12:19:58.211Z","etag":null,"topics":["lzwme","nodejs","server"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/lzwme.png","metadata":{"files":{"readme":"README.MD","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","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}},"created_at":"2021-07-12T05:38:05.000Z","updated_at":"2025-11-04T10:39:38.000Z","dependencies_parsed_at":"2023-12-25T09:46:10.952Z","dependency_job_id":"bf7e45e8-e6bf-400a-adb9-759a3cb13ac6","html_url":"https://github.com/lzwme/static-server","commit_stats":{"total_commits":30,"total_committers":1,"mean_commits":30.0,"dds":0.0,"last_synced_commit":"902eeebc340b4af7403472f62805dc0fafd0d0d7"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/lzwme/static-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzwme%2Fstatic-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzwme%2Fstatic-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzwme%2Fstatic-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzwme%2Fstatic-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lzwme","download_url":"https://codeload.github.com/lzwme/static-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzwme%2Fstatic-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30342161,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"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":["lzwme","nodejs","server"],"created_at":"2024-12-27T12:13:23.802Z","updated_at":"2026-03-10T16:13:13.034Z","avatar_url":"https://github.com/lzwme.png","language":"TypeScript","readme":"[![@lzwme/sserver](https://nodei.co/npm/@lzwme/sserver.png)][npm-url]\n\n# @lzwme/sserver\n\n[![NPM version][npm-badge]][npm-url]\n[![node version][node-badge]][node-url]\n[![npm download][download-badge]][download-url]\n[![GitHub issues][issues-badge]][issues-url]\n[![GitHub forks][forks-badge]][forks-url]\n[![GitHub stars][stars-badge]][stars-url]\n\n一个基于 Node.js 的简易静态服务器，用于辅助开发调试随启随用。\n\n```bash\n# 快速启动一个静态服务器\nnpx @lzwme/sserver -d ./dist\n```\n\n## 安装\n\n```bash\n# 全局安装\nnpm i -g @lzwme/sserver\nss -h\n\n# 或者在项目中安装\nnpm i -D @lzwme/sserver\nnpm exec ss -- -h\n\n# 或者直接使用 `npx`\nnpx @lzwme/sserver -h\n```\n\n## 使用\n\n示例：\n\n```bash\n# 以当前目录下的 dist 作为静态根目录\nss -d ./dist\n\n# 启用 https\nss --https\n\n# 启用 https，指定域名(默认为 localhost)\nss -H --host local.lzw.me\n\n# 启用 https，并保存默认生成的 ssl 证书\nss -H --ssl-cache ./cache\n```\n\n### 配置代理转发\n\n支持通过配置文件 `ss.config.js` 指定代理转发等详细配置规则。\n\n```bash\n# 在当前目录初始化一个 ss.config.js 配置文件\nss init\n```\n\n配置文件内容示例：\n\n```js\n// ss.config.js\n\n/** @type {import('@lzwme/sserver').SSConfig} */\nmodule.exports = {\n  port: 8888,\n  https: false,\n  sslCache: '',\n  rootDir: '.',\n  // 代理转发配置\n  proxyConfig: [\n    // 内网代理企业微信机器人接口示例\n    {\n      api: '/proxy/cgi-bin/webhook/send',\n      config: {\n        target: 'https://qyapi.weixin.qq.com',\n        changeOrigin: true,\n        pathRewrite: {\n          '^/proxy/cgi-bin': '/cgi-bin',\n        },\n      },\n    },\n  ],\n}\n```\n\n## 开发\n\n本地二次开发：\n\n```bash\ngit clone https://github.com/lzwme/static-server.git\npnpm install\npnpm build\n\n# dev\npnpm dev\n\n# global link\nnpm link\n```\n\n或者 fork 本项目进行代码贡献。\n\n**欢迎贡献想法与代码。**\n\n## License\n\n`@lzwme/sserver` is released under the MIT license.\n\n该插件由[志文工作室](https://lzw.me)开发和维护。\n\n\n[stars-badge]: https://img.shields.io/github/stars/lzwme/static-server.svg\n[stars-url]: https://github.com/lzwme/static-server/stargazers\n[forks-badge]: https://img.shields.io/github/forks/lzwme/static-server.svg\n[forks-url]: https://github.com/lzwme/static-server/network\n[issues-badge]: https://img.shields.io/github/issues/lzwme/static-server.svg\n[issues-url]: https://github.com/lzwme/static-server/issues\n[npm-badge]: https://img.shields.io/npm/v/@lzwme/sserver.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/@lzwme/sserver\n[node-badge]: https://img.shields.io/badge/node.js-%3E=_10.0.0-green.svg?style=flat-square\n[node-url]: https://nodejs.org/download/\n[download-badge]: https://img.shields.io/npm/dm/@lzwme/sserver.svg?style=flat-square\n[download-url]: https://npmjs.org/package/@lzwme/sserver\n[bundlephobia-url]: https://bundlephobia.com/result?p=@lzwme/sserver@latest\n[bundlephobia-badge]: https://badgen.net/bundlephobia/minzip/@lzwme/sserver@latest\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flzwme%2Fstatic-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flzwme%2Fstatic-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flzwme%2Fstatic-server/lists"}