-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
26 changed files
with
234 additions
and
127 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
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,5 +1,5 @@ | ||
#/bash/sh | ||
export VERSION=0.26.6 | ||
export VERSION=0.26.7 | ||
export GOPROXY=direct | ||
|
||
sudo apt-get update | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,23 +21,24 @@ import ( | |
) | ||
|
||
var ( | ||
serverAddr = flag.String("server", "", "Server addr (ip:port)") | ||
configPath = flag.String("config", "", "Configuration file path") | ||
verifyKey = flag.String("vkey", "", "Authentication key") | ||
logType = flag.String("log", "stdout", "Log output mode(stdout|file)") | ||
connType = flag.String("type", "tcp", "Connection type with the server(kcp|tcp)") | ||
proxyUrl = flag.String("proxy", "", "proxy socks5 url(eg:socks5://111:[email protected]:9007)") | ||
logLevel = flag.String("log_level", "7", "log level 0~7") | ||
registerTime = flag.Int("time", 2, "register time long /h") | ||
localPort = flag.Int("local_port", 2000, "p2p local port") | ||
password = flag.String("password", "", "p2p password flag") | ||
target = flag.String("target", "", "p2p target") | ||
localType = flag.String("local_type", "p2p", "p2p target") | ||
logPath = flag.String("log_path", "", "npc log path") | ||
debug = flag.Bool("debug", true, "npc debug") | ||
pprofAddr = flag.String("pprof", "", "PProf debug addr (ip:port)") | ||
stunAddr = flag.String("stun_addr", "stun.stunprotocol.org:3478", "stun server address (eg:stun.stunprotocol.org:3478)") | ||
ver = flag.Bool("version", false, "show current version") | ||
serverAddr = flag.String("server", "", "Server addr (ip:port)") | ||
configPath = flag.String("config", "", "Configuration file path") | ||
verifyKey = flag.String("vkey", "", "Authentication key") | ||
logType = flag.String("log", "stdout", "Log output mode(stdout|file)") | ||
connType = flag.String("type", "tcp", "Connection type with the server(kcp|tcp)") | ||
proxyUrl = flag.String("proxy", "", "proxy socks5 url(eg:socks5://111:[email protected]:9007)") | ||
logLevel = flag.String("log_level", "7", "log level 0~7") | ||
registerTime = flag.Int("time", 2, "register time long /h") | ||
localPort = flag.Int("local_port", 2000, "p2p local port") | ||
password = flag.String("password", "", "p2p password flag") | ||
target = flag.String("target", "", "p2p target") | ||
localType = flag.String("local_type", "p2p", "p2p target") | ||
logPath = flag.String("log_path", "", "npc log path") | ||
debug = flag.Bool("debug", true, "npc debug") | ||
pprofAddr = flag.String("pprof", "", "PProf debug addr (ip:port)") | ||
stunAddr = flag.String("stun_addr", "stun.stunprotocol.org:3478", "stun server address (eg:stun.stunprotocol.org:3478)") | ||
ver = flag.Bool("version", false, "show current version") | ||
disconnectTime = flag.Int("disconnect_timeout", 60, "not receiving check packet times, until timeout will disconnect the client") | ||
) | ||
|
||
func main() { | ||
|
@@ -218,6 +219,7 @@ func run() { | |
commonConfig.Client = new(file.Client) | ||
commonConfig.Client.Cnf = new(file.Config) | ||
go client.StartLocalServer(localServer, commonConfig) | ||
return | ||
} | ||
env := common.GetEnvMap() | ||
if *serverAddr == "" { | ||
|
@@ -230,7 +232,7 @@ func run() { | |
if *verifyKey != "" && *serverAddr != "" && *configPath == "" { | ||
go func() { | ||
for { | ||
client.NewRPClient(*serverAddr, *verifyKey, *connType, *proxyUrl, nil).Start() | ||
client.NewRPClient(*serverAddr, *verifyKey, *connType, *proxyUrl, nil, *disconnectTime).Start() | ||
logs.Info("It will be reconnected in five seconds") | ||
time.Sleep(time.Second * 5) | ||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
![logo](logo.svg) | ||
|
||
# NPS <small>0.26.6</small> | ||
# NPS <small>0.26.7</small> | ||
|
||
> 一款轻量级、高性能、功能强大的内网穿透代理服务器 | ||
|
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.