Code Monkey home page Code Monkey logo

ehang-io / nps Goto Github PK

View Code? Open in Web Editor NEW
29.1K 470.0 5.3K 8.95 MB

一款轻量级、高性能、功能强大的内网穿透代理服务器。支持tcp、udp、socks5、http等几乎所有流量转发,可用来访问内网网站、本地支付接口调试、ssh访问、远程桌面,内网dns解析、内网socks5代理等等……,并带有功能强大的web管理端。a lightweight, high-performance, powerful intranet penetration proxy server, with a powerful web management terminal.

Home Page: https://ehang.io/nps/documents

License: GNU General Public License v3.0

Go 96.52% Makefile 0.27% Shell 3.21%
socks tcp gzip udp snnapy go nat firewall tunnel ssh

nps's Introduction

NPS

Gitter Release GitHub All Releases

README|中文文档

NPS is a lightweight, high-performance, powerful intranet penetration proxy server, with a powerful web management terminal.

image

Feature

  • 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, Synology, 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.

Didn't find the feature you want? It doesn't matter, click Enter the document to find it!

Quick start

Installation

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.

  • execute installation command

For linux、darwin sudo ./nps install

For windows, run cmd as administrator and enter the installation directory nps.exe install

  • default ports

The default configuration file of nps use 80,443,8080,8024 ports

80 and 443 ports for host mode default ports

8080 for web management access port

8024 for net bridge port, to communicate between server and client

  • start up

For linux、darwin sudo nps start

For windows, run cmd as administrator and enter the program directory nps.exe start

After installation, the windows configuration file is located at C:\Program Files\nps, linux or darwin is located at /etc/nps

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).

  • 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.

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.

If you need to register to the system service, you can check Register to the system service

Configuration

  • After the client connects, configure the corresponding penetration service in the web.
  • For more advanced usage, see Complete Documentation

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.

nps's People

Contributors

arugal avatar avengexyz avatar bigcoder84 avatar caiych avatar callantaylor avatar clh021 avatar cnlh avatar daanikus avatar dalerkd avatar deltaxraydelta avatar evangwt avatar exfly avatar ffdfgdfg avatar geek981108 avatar hanxi avatar hellodword avatar hzgjq avatar kekxv avatar libotony avatar lidenggao avatar lpxxn avatar lroccoon avatar snowie2000 avatar thelittlefox avatar waysup avatar wuhanstudio avatar wyaode avatar xiexiao avatar yzy613 avatar zouri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nps's Issues

功能改进建议

希望支持自定义连接密码(同时支持随机生成),当用户设置用户密码重复时给出提示

希望增加HTTPS代理

看到软件是支持了HTTPS 但操作起来很不方便 希望能像HTTP代理那里添加,还有就是ID,ID添加了,删除项后 ID一直存在而且不断增加,看起来怪怪的,ID项添加删除,应该会回到原来值

服务端能不能查看服务器状态?

服务端能不能查看服务器状态?
例如:
服务器当前上传下载带宽;
服务器当前tcp连接数
服务器当前udp连接数
服务器当前CPU占用
服务器当前RAM占用
........
这些都是很有必要的,希望能够在web主页面板添加。

功能改进建议

  1. 每个连接能添加备注,不然连接太多不好区分。
  2. 能以客户端为单位管理连接,连接密码为某一个客户端连接密钥,可以自定义每个客户端连接密钥,该客户端下添加端口映射不再需要单独的密钥,这样的话管理客户端会很方便。
    希望easyproxy更好,谢谢!

功能改进建议

如果已有一个客户端上线,另外一个客户端用同样的密钥登录服务器时,可否提示用户?

多次产生内存访问错误导致服务端崩溃

报错内容:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x737076]

goroutine 59 [running]:
github.com/cnlh/nps/lib/conn.(*Conn).WriteWriteSuccess(0x0, 0x1, 0x255, 0x8000)
/Users/liuhe/go/src/github.com/cnlh/nps/lib/conn/conn.go:399 +0x26
github.com/cnlh/nps/lib/conn.(*Link).Run.func1(0xc0000e2b00, 0xc0000e2b01)
/Users/liuhe/go/src/github.com/cnlh/nps/lib/conn/link.go:71 +0x38
created by github.com/cnlh/nps/lib/conn.(*Link).Run
/Users/liuhe/go/src/github.com/cnlh/nps/lib/conn/link.go:47 +0x48

另外,建议添加服务端自动重启功能

当前最新版本编译失败,tag的v16版本编译成功

go版本号

root@7209df7aeb96:/usr/src/myapp/easyProxy# go version
go version go1.9.7 linux/amd64
root@7209df7aeb96:/usr/src/myapp/easyProxy#

编译报错
go build cmd/proxy_client/proxy_client.go
提示找不到utils包

尝试复制utils文件夹到对应目录,会报错更多信息。。。
还请指点下如果能正常编译出来,谢谢!

如果采用 git checkout tag v.17 再进行编译,可以成功生成bin文件。 不过和当前版本应该有很多不一样,那个是客户端和服务端都在一个可执行程序里面。

功能改进建议:增加支持多通道数据转发

功能:域名转发
环境:WIN7+IIS
测试方法:浏览器访问转发端口的一个视频文件。在浏览器中播放时,通过golang GET方法获取一个txt文本文件,记录GET所需要的时间。循环每秒GET一次文件。
发现问题:当浏览器播放视频时,获取文本文件所需要的时间为3-9秒,也有超时问题。当停止播放文件时,获取文本文件所需要的时间为0-11毫秒。。

估计是播放视频时,占用转发通道时间过长,希望改进这一问题。。。

关于PutBufPoolCopy

为什么不用io.Copy呢?测试下来反而比PutBufPoolCopy更省内存。

通过socks5代理 udp传输报错

2019/01/12 06:34:43 UDP Associate
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x85dfd9]

goroutine 35 [running]:
github.com/cnlh/easyProxy/bridge.(*Tunnel).ReturnTunnel(0xc0001392c0, 0x0, 0xc0000230a0, 0x20)
        /Users/liuhe/go/src/github.com/cnlh/easyProxy/bridge/bridge.go:187 +0x79
github.com/cnlh/easyProxy/server.(*Sock5ModeServer).handleUDP.func1(0xc000286030, 0x0)
        /Users/liuhe/go/src/github.com/cnlh/easyProxy/server/socks5.go:204 +0x6f
github.com/cnlh/easyProxy/server.(*Sock5ModeServer).handleUDP(0xc000286030, 0xa17aa0, 0xc00000c0e0)
        /Users/liuhe/go/src/github.com/cnlh/easyProxy/server/socks5.go:213 +0x191
github.com/cnlh/easyProxy/server.(*Sock5ModeServer).handleRequest(0xc000286030, 0xa17aa0, 0xc00000c0e0)
        /Users/liuhe/go/src/github.com/cnlh/easyProxy/server/socks5.go:81 +0x1af
github.com/cnlh/easyProxy/server.(*Sock5ModeServer).handleConn(0xc000286030, 0xa17aa0, 0xc00000c0e0)
        /Users/liuhe/go/src/github.com/cnlh/easyProxy/server/socks5.go:249 +0x337
created by github.com/cnlh/easyProxy/server.(*Sock5ModeServer).Start
        /Users/liuhe/go/src/github.com/cnlh/easyProxy/server/socks5.go:303 +0x114

是否可以增加管道模式

A电脑 访问本机X端口,实际访问服务器Y端口。

本机X端口与服务器Y端口,通过本Porxy通信,解决效率问题,对于长连接也能实现断网重连。

p2p

请问支持p2p模式吗

我使用http代理失败

in address 2019/02/02 08:41:40 connect to 127.0.0.1:63342 error: dial tcp 127.0.0.1:63342: connect: connection refused 2019/02/02 08:41:44 connect to github:80 error: dial tcp: lookup github on 108.61.10.10:53: no such host 2019/02/02 08:41:45 connect to www.baidu.com:443:443 error: dial tcp: address www.baidu.com:443:443: too many colons in address 2019/02/02 08:41:47 connect to www.baidu.com:443:443 error: dial tcp: address www.baidu.com:443:443: too many colons in address 2019/02/02 08:41:49 connect to drm.media.baidubce.com:8888:80 error: dial tcp: address drm.media.baidubce.com:8888:80: too many colons in address 2019/02/02 08:41:51 connect to 127.0.0.1:63342 error: dial tcp 127.0.0.1:63342: connect: connection refused 2019/02/02 08:41:52 connect to www.baidu.com:443:443 error: dial tcp: address www.baidu.com:443:443: too many colons in address 2019/02/02 08:41:58 connect to android.clients.google.com:443:443 error: dial tcp: address android.clients.google.com:443:443: too many colons in address
我看到所有端口都重复写了两遍,这是不是一个bug,我的go go version go1.11 linux/amd64

建议更换这种Web UI

看了下后台的UI,感觉看起来还是不太协调,功能也不太强。
例如:
1.列表排序,升序降序,查找;
2.API管理,多管理员授权;
3.后台管理员设置,密码找回;
4.用户,管理员操作日志,统计图统计;
......
建议:
更换UI,可以参考:https://www.layui.com/admin/pro/

在非编译的目录运行程序会报错

  1. 在非程序目录运行程序会报错,希望支持相对路径运行,望修复
  2. 希望增加程序的守护进程,时不时发现程序会自己停止
  3. 希望增加流量统计功能

变量名tcpport能否都统一修改成bridgePort

变量名tcpport能否都统一修改成bridgePort,这个tcpport和tcp代理容易误读
task := &file.Tunnel{
TcpPort: *httpPort,
Mode: *rpMode,
Target: *tunnelTarget,
Config: &file.Config{
U: *u,
P: *p,
Compress: *compress,
Crypt: common.GetBoolByStr(*crypt),
},
Flow: &file.Flow{},
UseClientCnf: false,
}
这里也用到TcpPort,但是却是说的httpPort

在启动proxy_server遇到空指针的问题。

报错提示如下:
[root@ds_beta easyProxy]# ./proxy_server -mode=socks5Server -vkey=DKibZF5TXvic1g3kY -tcpport=8284 -httpport=8024
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb0451f]

goroutine 1 [running]:
main.main()
/home/work/go/src/github.com/cnlh/easyProxy/cmd/proxy_server/proxy_server.go:50 +0xe1f

系统及go版本:
[root@ds_beta easyProxy]# cat /etc/redhat-release
CentOS release 6.5 (Final)
[root@ds_beta easyProxy]# go version
go version go1.11.2 linux/amd64

服务端的app.conf里的tcpport配置无效

服务端的app.conf里的tcpport配置无效(配置了其他端口还是使用默认端口8284等待连接),只有命令行参数加tcpport才有效,是程序加载配置漏了吧

域名代理模式BUG反馈

域名代理模式下面添加了隧道后,如果添加了对应的域名和IP,但是删除隧道时,域名任然会在hosts.csv文件存在,并未清除。
希望修复。

如何给本地网络其他设备做端口范围映射

例如本地有两个设备A和B,只有设备A装有nps,如何把B设备的1000-2000端口映射到服务器上的一段范围内的端口。

建议:

nps虽然以客户端为单位进行管理,但是客户端ID和密钥会一直变(网络断开重连就会变),如果我有批量的设备都装有nps那么,我无法知道哪个客户端对应哪个设备。frp就没有这个问题,因为可以自定义客户端ID,frp的问题在于无法在服务器上动态进行转发配置,这也是nps的优势。

authip建议改成authkey

使用authip不方便,因为ip可能有改变,建议使用authkey,提交api的时候带key参数

运行模式不方便

我试一下,发现web,tcp,或usp要的运行模式都不都-mode=模式,我一台内网中,我有WEB和其它端口转发,发而很不方便了,加上我发现HTTPS也没有,网站上运行HTTPS,这个功能不能实现

client 需要cvs文件否则无法启动

环境

server: linux 64
client: arm
version: 0.0.16

现象

客户端:
panic: open /root/conf/clients.csv: no such file or directory
panic: open /root/conf/tasks.csv: no such file or directory
panic: open /root/conf/hosts.csv: no such file or directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.