forked from ehang-io/nps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ehang-io#360 from ehang-io/dev
Dev
- Loading branch information
Showing
70 changed files
with
1,624 additions
and
452 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
FROM golang as builder | ||
WORKDIR /go/src/github.com/cnlh/nps | ||
WORKDIR /go/src/ehang.io/nps | ||
COPY . . | ||
RUN go get -d -v ./... | ||
RUN CGO_ENABLED=0 go build -ldflags="-w -s -extldflags -static" ./cmd/npc/npc.go | ||
|
||
FROM scratch | ||
COPY --from=builder /go/src/github.com/cnlh/nps/npc / | ||
COPY --from=builder /go/src/ehang.io/nps/npc / | ||
VOLUME /conf | ||
ENTRYPOINT ["/npc"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
FROM golang as builder | ||
WORKDIR /go/src/github.com/cnlh/nps | ||
WORKDIR /go/src/ehang.io/nps | ||
COPY . . | ||
RUN go get -d -v ./... | ||
RUN CGO_ENABLED=0 go build -ldflags="-w -s -extldflags -static" ./cmd/nps/nps.go | ||
|
||
FROM scratch | ||
COPY --from=builder /go/src/github.com/cnlh/nps/nps / | ||
COPY --from=builder /go/src/github.com/cnlh/nps/web /web | ||
COPY --from=builder /go/src/ehang.io/nps/nps / | ||
COPY --from=builder /go/src/ehang.io/nps/web /web | ||
VOLUME /conf | ||
CMD ["/nps"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,76 @@ | ||
|
||
# nps | ||
![](https://img.shields.io/github/stars/cnlh/nps.svg) ![](https://img.shields.io/github/forks/cnlh/nps.svg) | ||
# NPS | ||
![](https://img.shields.io/github/stars/ehang-io/nps.svg) ![](https://img.shields.io/github/forks/ehang-io/nps.svg) | ||
[![Gitter](https://badges.gitter.im/cnlh-nps/community.svg)](https://gitter.im/cnlh-nps/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) | ||
[![Build Status](https://travis-ci.org/cnlh/nps.svg?branch=master)](https://travis-ci.org/cnlh/nps) | ||
![GitHub All Releases](https://img.shields.io/github/downloads/cnlh/nps/total) | ||
[![Build Status](https://travis-ci.org/ehang-io/nps.svg?branch=master)](https://travis-ci.org/ehang-io/nps) | ||
![GitHub All Releases](https://img.shields.io/github/downloads/ehang-io/nps/total) | ||
|
||
nps是一款轻量级、高性能、功能强大的**内网穿透**代理服务器。目前支持**tcp、udp流量转发**,可支持任何**tcp、udp**上层协议(访问内网网站、本地支付接口调试、ssh访问、远程桌面,内网dns解析等等……),此外还**支持内网http代理、内网socks5代理**、**p2p等**,并带有功能强大的web管理端。 | ||
[README](https://github.com/ehang-io/nps/blob/master/README.md)|[中文文档](https://github.com/ehang-io/nps/blob/master/README_zh.md) | ||
|
||
NPS is a lightweight, high-performance, powerful **intranet penetration** proxy server, with a powerful web management terminal. | ||
|
||
## 背景 | ||
![image](https://github.com/cnlh/nps/blob/master/image/web.png?raw=true) | ||
|
||
1. 做微信公众号开发、小程序开发等----> 域名代理模式 | ||
![image](https://github.com/ehang-io/nps/blob/master/image/web.png?raw=true) | ||
|
||
2. 想在外网通过ssh连接内网的机器,做云服务器到内网服务器端口的映射,----> tcp代理模式 | ||
## Feature | ||
|
||
3. 在非内网环境下使用内网dns,或者需要通过udp访问内网机器等----> udp代理模式 | ||
- Comprehensive protocol support, compatible with almost all commonly used protocols, such as tcp, udp, http(s), socks5, p2p, http proxy ... | ||
- Full platform compatibility (linux, windows, macos, Qunhui, etc.), support installation as a system service simply. | ||
- Comprehensive control, both client and server control are allowed. | ||
- Https integration, support to convert backend proxy and web services to https, and support multiple certificates. | ||
- Just simple configuration on web ui can complete most requirements. | ||
- Complete information display, such as traffic, system information, real-time bandwidth, client version, etc. | ||
- Powerful extension functions, everything is available (cache, compression, encryption, traffic limit, bandwidth limit, port reuse, etc.) | ||
- Domain name resolution has functions such as custom headers, 404 page configuration, host modification, site protection, URL routing, and pan-resolution. | ||
- Multi-user and user registration support on server. | ||
|
||
4. 在外网使用HTTP代理访问内网站点----> http代理模式 | ||
**Didn't find the feature you want? It doesn't matter, click [Enter the document](https://ehang-io.github.io/nps/) to find it!** | ||
|
||
5. 搭建一个内网穿透ss,在外网如同使用内网vpn一样访问内网资源或者设备----> socks5代理模式 | ||
## 特点 | ||
- 协议支持全面,兼容几乎所有常用协议,例如tcp、udp、http(s)、socks5、p2p、http代理... | ||
- 全平台兼容(linux、windows、macos、群辉等),支持一键安装为系统服务 | ||
- 控制全面,同时支持服务端和客户端控制 | ||
- https集成,支持将后端代理和web服务转成https,同时支持多证书 | ||
- 操作简单,只需简单的配置即可在web ui上完成其余操作 | ||
- 展示信息全面,流量、系统信息、即时带宽、客户端版本等 | ||
- 扩展功能强大,该有的都有了(缓存、压缩、加密、流量限制、带宽限制、端口复用等等) | ||
- 域名解析具备自定义header、404页面配置、host修改、站点保护、URL路由、泛解析等功能 | ||
- 服务端支持多用户和用户注册功能 | ||
## Quick start | ||
|
||
**没找到你想要的功能?不要紧,点击[进入文档](https://ehang-io.github.io/nps)查找吧** | ||
## 快速开始 | ||
### Installation | ||
|
||
### 安装 | ||
> [releases](https://github.com/cnlh/nps/releases) | ||
> [releases](https://github.com/ehang-io/nps/releases) | ||
下载对应的系统版本即可,服务端和客户端是单独的 | ||
Download the corresponding system version, the server and client are separate. | ||
|
||
### 服务端启动 | ||
下载完服务器压缩包后,解压,然后进入解压后的文件夹 | ||
### Server start | ||
|
||
- 执行安装命令 | ||
After downloading the server compressed package, unzip it, and then enter the unzipped folder. | ||
|
||
对于linux|darwin ```sudo ./nps install``` | ||
- execute installation command | ||
|
||
对于windows,管理员身份运行cmd,进入安装目录 ```nps.exe install``` | ||
For linux、darwin ```sudo ./nps install``` | ||
|
||
- 启动 | ||
For windows, run cmd as administrator and enter the installation directory ```nps.exe install``` | ||
|
||
对于linux|darwin ```sudo nps start``` | ||
- start up | ||
|
||
对于windows,管理员身份运行cmd,进入程序目录 ```nps.exe start``` | ||
For linux、darwin ```sudo nps start``` | ||
|
||
```安装后windows配置文件位于 C:\Program Files\nps,linux和darwin位于/etc/nps``` | ||
For windows, run cmd as administrator and enter the program directory ```nps.exe start``` | ||
|
||
**如果发现没有启动成功,可以查看日志(Windows日志文件位于当前运行目录下,linux和darwin位于/var/log/nps.log)** | ||
- 访问服务端ip:web服务端口(默认为8080) | ||
- 使用用户名和密码登陆(默认admin/123,正式使用一定要更改) | ||
- 创建客户端 | ||
```After installation, the windows configuration file is located at C:\Program Files\nps, linux or darwin is located at /etc/nps``` | ||
|
||
### 客户端连接 | ||
- 点击web管理中客户端前的+号,复制启动命令 | ||
- 执行启动命令,linux直接执行即可,windows将./npc换成npc.exe用cmd执行 | ||
**If you don't find it started successfully, you can check the log (Windows log files are located in the current running directory, linux and darwin are located in /var/log/nps.log).** | ||
|
||
如果需要注册到系统服务可查看[注册到系统服务](https://ehang-io.github.io/nps/#/use?id=注册到系统服务) | ||
- Access server IP:web service port (default is 8080). | ||
- Login with username and password (default is admin/123, must be modified when officially used). | ||
- Create a client. | ||
|
||
### 配置 | ||
- 客户端连接后,在web中配置对应穿透服务即可 | ||
- 更多高级用法见[完整文档](https://ehang-io.github.io/nps) | ||
### Client connection | ||
- Click the + sign in front of the client in web management and copy the startup command. | ||
- Execute the startup command, Linux can be executed directly, Windows will replace ./npc with npc.exe and execute it with cmd. | ||
|
||
## 贡献 | ||
- 如果遇到bug可以直接提交至dev分支 | ||
- 使用遇到问题可以通过issues反馈 | ||
- 项目处于开发阶段,还有很多待完善的地方,如果可以贡献代码,请提交 PR 至 dev 分支 | ||
- 如果有新的功能特性反馈,可以通过issues或者qq群反馈 | ||
|
||
If you need to register to the system service, you can check [Register to the system service](https://ehang-io.github.io/nps/#/use?id=注册到系统服务) | ||
|
||
### Configuration | ||
- After the client connects, configure the corresponding penetration service in the web. | ||
- For more advanced usage, see [Complete Documentation](https://ehang-io.github.io/nps/) | ||
|
||
## Contribution | ||
- If you encounter a bug, you can submit it to the dev branch directly. | ||
- If you encounter a problem, you can feedback through the issue. | ||
- The project is under development, and there is still a lot of room for improvement. If you can contribute code, please submit PR to the dev branch. | ||
- If there is feedback on new features, you can feedback via issues or qq group. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
|
||
# nps | ||
![](https://img.shields.io/github/stars/ehang-io/nps.svg) ![](https://img.shields.io/github/forks/ehang-io/nps.svg) | ||
[![Gitter](https://badges.gitter.im/cnlh-nps/community.svg)](https://gitter.im/cnlh-nps/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) | ||
[![Build Status](https://travis-ci.org/ehang-io/nps.svg?branch=master)](https://travis-ci.org/ehang-io/nps) | ||
![GitHub All Releases](https://img.shields.io/github/downloads/ehang-io/nps/total) | ||
|
||
[README](https://github.com/ehang-io/nps/blob/master/README.md)|[中文文档](https://github.com/ehang-io/nps/blob/master/README_zh.md) | ||
|
||
nps是一款轻量级、高性能、功能强大的**内网穿透**代理服务器。目前支持**tcp、udp流量转发**,可支持任何**tcp、udp**上层协议(访问内网网站、本地支付接口调试、ssh访问、远程桌面,内网dns解析等等……),此外还**支持内网http代理、内网socks5代理**、**p2p等**,并带有功能强大的web管理端。 | ||
|
||
|
||
## 背景 | ||
![image](https://github.com/ehang-io/nps/blob/master/image/web.png?raw=true) | ||
|
||
1. 做微信公众号开发、小程序开发等----> 域名代理模式 | ||
|
||
2. 想在外网通过ssh连接内网的机器,做云服务器到内网服务器端口的映射,----> tcp代理模式 | ||
|
||
3. 在非内网环境下使用内网dns,或者需要通过udp访问内网机器等----> udp代理模式 | ||
|
||
4. 在外网使用HTTP代理访问内网站点----> http代理模式 | ||
|
||
5. 搭建一个内网穿透ss,在外网如同使用内网vpn一样访问内网资源或者设备----> socks5代理模式 | ||
## 特点 | ||
- 协议支持全面,兼容几乎所有常用协议,例如tcp、udp、http(s)、socks5、p2p、http代理... | ||
- 全平台兼容(linux、windows、macos、群辉等),支持一键安装为系统服务 | ||
- 控制全面,同时支持服务端和客户端控制 | ||
- https集成,支持将后端代理和web服务转成https,同时支持多证书 | ||
- 操作简单,只需简单的配置即可在web ui上完成其余操作 | ||
- 展示信息全面,流量、系统信息、即时带宽、客户端版本等 | ||
- 扩展功能强大,该有的都有了(缓存、压缩、加密、流量限制、带宽限制、端口复用等等) | ||
- 域名解析具备自定义header、404页面配置、host修改、站点保护、URL路由、泛解析等功能 | ||
- 服务端支持多用户和用户注册功能 | ||
|
||
**没找到你想要的功能?不要紧,点击[进入文档](https://ehang-io.github.io/nps)查找吧** | ||
## 快速开始 | ||
|
||
### 安装 | ||
> [releases](https://github.com/ehang-io/nps/releases) | ||
下载对应的系统版本即可,服务端和客户端是单独的 | ||
|
||
### 服务端启动 | ||
下载完服务器压缩包后,解压,然后进入解压后的文件夹 | ||
|
||
- 执行安装命令 | ||
|
||
对于linux|darwin ```sudo ./nps install``` | ||
|
||
对于windows,管理员身份运行cmd,进入安装目录 ```nps.exe install``` | ||
|
||
- 启动 | ||
|
||
对于linux|darwin ```sudo nps start``` | ||
|
||
对于windows,管理员身份运行cmd,进入程序目录 ```nps.exe start``` | ||
|
||
```安装后windows配置文件位于 C:\Program Files\nps,linux和darwin位于/etc/nps``` | ||
|
||
**如果发现没有启动成功,可以查看日志(Windows日志文件位于当前运行目录下,linux和darwin位于/var/log/nps.log)** | ||
- 访问服务端ip:web服务端口(默认为8080) | ||
- 使用用户名和密码登陆(默认admin/123,正式使用一定要更改) | ||
- 创建客户端 | ||
|
||
### 客户端连接 | ||
- 点击web管理中客户端前的+号,复制启动命令 | ||
- 执行启动命令,linux直接执行即可,windows将./npc换成npc.exe用cmd执行 | ||
|
||
如果需要注册到系统服务可查看[注册到系统服务](https://ehang-io.github.io/nps/#/use?id=注册到系统服务) | ||
|
||
### 配置 | ||
- 客户端连接后,在web中配置对应穿透服务即可 | ||
- 更多高级用法见[完整文档](https://ehang-io.github.io/nps/) | ||
|
||
## 贡献 | ||
- 如果遇到bug可以直接提交至dev分支 | ||
- 使用遇到问题可以通过issues反馈 | ||
- 项目处于开发阶段,还有很多待完善的地方,如果可以贡献代码,请提交 PR 至 dev 分支 | ||
- 如果有新的功能特性反馈,可以通过issues或者qq群反馈 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.