| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
中文 | English | Server Guide | 服务端说明
说明:本仓库基于原项目 tmoonlight/NSmartProxy fork 后继续维护和修改。
NSmartProxy 是一个基于“反向连接池 + 服务端统一转发”的内网穿透工具。
它的工作方式不是 P2P 打洞,而是:
当前仓库已经整理到更适合实际部署的状态:
下面是一套当前最推荐、也是本次联调验证过的最小用法。
服务端配置文件示例,见 src/NSmartProxy.ServerHost/appsettings.json:
{
"ReversePort": 7842,
"ConfigPort": 7841,
"WebAPIPort": 12309,
"ReversePort_Out": 0,
"ConfigPort_Out": 0
}含义:
Linux 运行方式:
chmod +x ./NSmartProxy.ServerHost
./NSmartProxy.ServerHostWindows 运行方式:
.\NSmartProxy.ServerHost.exe启动后访问:
http://<server-ip>:12309
如果你使用的是已有数据库,请以现有用户体系为准。
客户端配置文件示例,见 src/NSmartProxyClient/appsettings.json。
下面给一个更贴近当前推荐用法的最小配置:
{
"ProviderWebPort": 12309,
"ProviderAddress": "your-server-ip",
"Clients": [
{
"IP": "127.0.0.1",
"TargetServicePort": 3000,
"ConsumerPort": 52999,
"Protocol": "TCP",
"IsCompress": false,
"Description": "local api"
}
]
}含义:
Windows 运行方式:
.\NSmartProxyClient.exe如需显式登录:
.\NSmartProxyClient.exe -u admin -p admin123Linux 或 macOS 运行方式:
chmod +x ./NSmartProxyClient
./NSmartProxyClient假设客户端把本地 127.0.0.1:3000 映射到了公网 52999,那么外部访问:
http://<server-ip>:52999
如果你映射的是 HTTP API,本地直连和公网访问应返回一致的状态码、响应头和响应体语义。
对于当前仓库代码状态,最推荐的部署组合是:
外部用户
-> 公网服务器
-> Nginx / Caddy
-> NSmartProxy 服务端
-> NSmartProxy 客户端
-> 本地真实服务
尤其是大模型中转站、OpenAI 兼容 API、SSE 流式响应场景,建议:
本地构建:
dotnet build .\src\NSmartProxy.ServerHost\NSmartProxy.ServerHost.csproj -c Release
dotnet build .\src\NSmartProxyClient\NSmartProxyClient.csproj -c Release自包含发布:
dotnet publish .\src\NSmartProxy.ServerHost\NSmartProxy.ServerHost.csproj -c Release -r linux-x64 --self-contained true
dotnet publish .\src\NSmartProxyClient\NSmartProxyClient.csproj -c Release -r win-x64 --self-contained true项目许可证见 LICENSE。
| Back | FazBrowse Home | New Git URL |