
Security News
GitHub to Block pull_request_target Workflows by Default Starting December 2
GitHub is tightening GitHub Actions security with new restrictions on privileged pull request workflows. Here's what changes and how maintainers are affected.
u32-local-server
Advanced tools
本地 HTTP 文件服务器 + CORS 代理,纯 Node.js 零依赖。
npm install -g u32-local-server
# 启动服务器(后台运行)
u32-ls start
# 停止服务器
u32-ls stop
# 开发模式(前台运行,监听文件变化)
npm run dev
默认端口 19527,启动后访问:
http://localhost:19527/config直接通过浏览器访问:
http://localhost:19527/file/~/http://localhost:19527/file/home/user/file.txthttp://localhost:19527/file/C:/Users/user/file.txt或者使用命令行工具:
# 获取文件/目录 URL
u32-ls url /path/to/file
# 在浏览器中打开
u32-ls open /path/to/file
# 复制 URL 到剪贴板
u32-ls copy-url /path/to/file
用于绕过浏览器的跨域限制:
// 原始 URL(可能有跨域问题)
fetch('https://api.example.com/data')
// 使用代理(无跨域问题)
fetch('http://localhost:19527/proxy/https://api.example.com/data')
代理特性:
accept-encoding 头(返回未压缩内容)x-frame-options 头(允许 iframe 嵌入)位置:~/.u32-local-server/config/main.json
首次启动自动创建,默认配置:
{
"port": 19527,
"file": {
"access": {
"allow": [],
"deny": []
},
"mime": {
".html": "text/html",
".js": "text/javascript",
".png": "image/png"
// ... 更多 MIME 类型
}
},
"proxy": {}
}
allow: 白名单,允许访问的路径前缀deny: 黑名单,拒绝访问的路径前缀deny > allow(黑名单优先)allow 为空时,拒绝访问所有文件(白名单模式)~/ 表示用户主目录示例:
{
"file": {
"access": {
"allow": ["~/", "/mnt/data"],
"deny": ["~/敏感文件夹", "/etc"]
}
}
}
访问 http://localhost:19527/config 可视化管理:
| 命令 | 说明 |
|---|---|
u32-ls start | 启动后台服务器 |
u32-ls stop | 停止服务器 |
u32-ls restart | 重启服务器 |
u32-ls status | 查看服务器状态 |
u32-ls logs [-f] | 查看服务器日志 |
u32-ls url <path> | 获取文件 URL |
u32-ls open <path> | 在浏览器中打开 |
u32-ls copy-url <path> | 复制 URL 到剪贴板 |
u32-ls register | 注册开机自启 + 右键菜单 |
u32-ls unregister | 取消注册 |
u32-ls version | 显示版本号 |
u32-ls --help | 显示帮助信息 |
运行 u32-ls register 后:
Run 键运行 u32-ls register 后:
| 路由 | 功能 |
|---|---|
/proxy/<url> | CORS 代理 |
/config | 配置管理页面 |
/config/api | 配置 REST API |
/file/<path> | 文件访问(Windows 盘符/~/ 支持) |
/ | 直接映射到文件系统(Linux) |
http 模块~# 克隆项目
git clone <repo>
cd u32-local-server
# 开发模式(监听文件变化)
npm run dev
# 手动启动
node src/index.js start
MIT
FAQs
Local HTTP file server and proxy
The npm package u32-local-server receives a total of 11 weekly downloads. As such, u32-local-server popularity was classified as not popular.
We found that u32-local-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
GitHub is tightening GitHub Actions security with new restrictions on privileged pull request workflows. Here's what changes and how maintainers are affected.

Security News
/Application Security
A practical guide to securing GitHub Actions against supply chain attacks, covering malicious pull requests, credential theft, dependency risks, and release pipelines.

Security News
Composer 2.11 adds dependency cooldowns, joining package managers that delay new releases to reduce supply chain risks while allowing urgent security updates.