mirror of
https://github.com/fatedier/frp.git
synced 2025-08-03 12:24:43 +00:00
Compare commits
55 Commits
256b87321d
...
v0.53.1
Author | SHA1 | Date | |
---|---|---|---|
|
2b83436a97 | ||
|
051299ec25 | ||
|
44985f574d | ||
|
c9ca9353cf | ||
|
31fa3f021a | ||
|
2d3af8a108 | ||
|
466d69eae0 | ||
|
7c8cbeb250 | ||
|
4fd6301577 | ||
|
53626b370c | ||
|
4fd800bc48 | ||
|
0d6d968fe8 | ||
|
8fb99ef7a9 | ||
|
88e74ff24d | ||
|
534dc99d55 | ||
|
595aba5a9b | ||
|
a4189ba474 | ||
|
9ec84f8143 | ||
|
8ab474cc97 | ||
|
a301046f3d | ||
|
8888610d83 | ||
|
fe5fb0326b | ||
|
eb1e19a821 | ||
|
10f2620131 | ||
|
ce677820c6 | ||
|
88fcc079e8 | ||
|
2dab5d0bca | ||
|
143750901e | ||
|
997d406ec2 | ||
|
cfd1a3128a | ||
|
57577ea044 | ||
|
c5c79e4148 | ||
|
55da58eca4 | ||
|
76a1efccd9 | ||
|
980f084ad1 | ||
|
3bf1eb8565 | ||
|
b2ae433e18 | ||
|
aa0a41ee4e | ||
|
1ea1530b36 | ||
|
e0c45a1aca | ||
|
813c45f5c2 | ||
|
aa74dc4646 | ||
|
2406ecdfea | ||
|
8668fef136 | ||
|
ea62bc5a34 | ||
|
23bb76397a | ||
|
487c8d7c29 | ||
|
f480160e2d | ||
|
30c246c488 | ||
|
75f3bce04d | ||
|
adc3adc13b | ||
|
e62d9a5242 | ||
|
134a46c00b | ||
|
ae08811636 | ||
|
6451583e60 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -34,8 +34,6 @@ dist/
|
|||||||
.idea/
|
.idea/
|
||||||
.vscode/
|
.vscode/
|
||||||
.autogen_ssh_key
|
.autogen_ssh_key
|
||||||
client.crt
|
|
||||||
client.key
|
|
||||||
|
|
||||||
# Cache
|
# Cache
|
||||||
*.swp
|
*.swp
|
||||||
|
@@ -332,7 +332,7 @@ func (svr *Service) loopLoginUntilSuccess(maxInterval time.Duration, firstLoginE
|
|||||||
// try to reconnect to server until success
|
// try to reconnect to server until success
|
||||||
wait.BackoffUntil(loginFunc, wait.NewFastBackoffManager(
|
wait.BackoffUntil(loginFunc, wait.NewFastBackoffManager(
|
||||||
wait.FastBackoffOptions{
|
wait.FastBackoffOptions{
|
||||||
Duration: time.Second,
|
Duration: time.Millisecond,
|
||||||
Factor: 2,
|
Factor: 2,
|
||||||
Jitter: 0.1,
|
Jitter: 0.1,
|
||||||
MaxDuration: maxInterval,
|
MaxDuration: maxInterval,
|
||||||
|
@@ -26,9 +26,5 @@ frpsPath=${ROOT}/bin/frps
|
|||||||
if [ "${FRPS_PATH}" ]; then
|
if [ "${FRPS_PATH}" ]; then
|
||||||
frpsPath="${FRPS_PATH}"
|
frpsPath="${FRPS_PATH}"
|
||||||
fi
|
fi
|
||||||
concurrency="16"
|
|
||||||
if [ "${CONCURRENCY}" ]; then
|
|
||||||
concurrency="${CONCURRENCY}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
ginkgo -nodes=${concurrency} --poll-progress-after=60s ${ROOT}/test/e2e -- -frpc-path=${frpcPath} -frps-path=${frpsPath} -log-level=${logLevel} -debug=${debug}
|
ginkgo -nodes=8 --poll-progress-after=60s ${ROOT}/test/e2e -- -frpc-path=${frpcPath} -frps-path=${frpsPath} -log-level=${logLevel} -debug=${debug}
|
||||||
|
@@ -19,7 +19,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
var version = "0.53.2"
|
var version = "0.53.1"
|
||||||
|
|
||||||
func Full() string {
|
func Full() string {
|
||||||
return version
|
return version
|
||||||
|
@@ -67,7 +67,7 @@ func NewDefaultFramework() *Framework {
|
|||||||
TotalParallelNode: suiteConfig.ParallelTotal,
|
TotalParallelNode: suiteConfig.ParallelTotal,
|
||||||
CurrentNodeIndex: suiteConfig.ParallelProcess,
|
CurrentNodeIndex: suiteConfig.ParallelProcess,
|
||||||
FromPortIndex: 10000,
|
FromPortIndex: 10000,
|
||||||
ToPortIndex: 30000,
|
ToPortIndex: 60000,
|
||||||
}
|
}
|
||||||
return NewFramework(options)
|
return NewFramework(options)
|
||||||
}
|
}
|
||||||
|
@@ -42,7 +42,7 @@ func (f *Framework) RunProcesses(serverTemplates []string, clientTemplates []str
|
|||||||
ExpectNoError(err)
|
ExpectNoError(err)
|
||||||
time.Sleep(500 * time.Millisecond)
|
time.Sleep(500 * time.Millisecond)
|
||||||
}
|
}
|
||||||
time.Sleep(2 * time.Second)
|
time.Sleep(1 * time.Second)
|
||||||
|
|
||||||
currentClientProcesses := make([]*process.Process, 0, len(clientTemplates))
|
currentClientProcesses := make([]*process.Process, 0, len(clientTemplates))
|
||||||
for i := range clientTemplates {
|
for i := range clientTemplates {
|
||||||
@@ -76,7 +76,7 @@ func (f *Framework) RunFrps(args ...string) (*process.Process, string, error) {
|
|||||||
return p, p.StdOutput(), err
|
return p, p.StdOutput(), err
|
||||||
}
|
}
|
||||||
// sleep for a while to get std output
|
// sleep for a while to get std output
|
||||||
time.Sleep(2 * time.Second)
|
time.Sleep(time.Second)
|
||||||
return p, p.StdOutput(), nil
|
return p, p.StdOutput(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ func (f *Framework) RunFrpc(args ...string) (*process.Process, string, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return p, p.StdOutput(), err
|
return p, p.StdOutput(), err
|
||||||
}
|
}
|
||||||
time.Sleep(2 * time.Second)
|
time.Sleep(time.Second)
|
||||||
return p, p.StdOutput(), nil
|
return p, p.StdOutput(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -22,11 +22,11 @@ var _ = ginkgo.Describe("[Feature: Server Manager]", func() {
|
|||||||
clientConf := consts.LegacyDefaultClientConfig
|
clientConf := consts.LegacyDefaultClientConfig
|
||||||
|
|
||||||
serverConf += `
|
serverConf += `
|
||||||
allow_ports = 10000-11000,11002,12000-13000
|
allow_ports = 20000-25000,25002,30000-50000
|
||||||
`
|
`
|
||||||
|
|
||||||
tcpPortName := port.GenName("TCP", port.WithRangePorts(10000, 11000))
|
tcpPortName := port.GenName("TCP", port.WithRangePorts(20000, 25000))
|
||||||
udpPortName := port.GenName("UDP", port.WithRangePorts(12000, 13000))
|
udpPortName := port.GenName("UDP", port.WithRangePorts(30000, 50000))
|
||||||
clientConf += fmt.Sprintf(`
|
clientConf += fmt.Sprintf(`
|
||||||
[tcp-allowded-in-range]
|
[tcp-allowded-in-range]
|
||||||
type = tcp
|
type = tcp
|
||||||
@@ -37,7 +37,7 @@ var _ = ginkgo.Describe("[Feature: Server Manager]", func() {
|
|||||||
[tcp-port-not-allowed]
|
[tcp-port-not-allowed]
|
||||||
type = tcp
|
type = tcp
|
||||||
local_port = {{ .%s }}
|
local_port = {{ .%s }}
|
||||||
remote_port = 11001
|
remote_port = 25001
|
||||||
`, framework.TCPEchoServerPort)
|
`, framework.TCPEchoServerPort)
|
||||||
clientConf += fmt.Sprintf(`
|
clientConf += fmt.Sprintf(`
|
||||||
[tcp-port-unavailable]
|
[tcp-port-unavailable]
|
||||||
@@ -55,7 +55,7 @@ var _ = ginkgo.Describe("[Feature: Server Manager]", func() {
|
|||||||
[udp-port-not-allowed]
|
[udp-port-not-allowed]
|
||||||
type = udp
|
type = udp
|
||||||
local_port = {{ .%s }}
|
local_port = {{ .%s }}
|
||||||
remote_port = 11003
|
remote_port = 25003
|
||||||
`, framework.UDPEchoServerPort)
|
`, framework.UDPEchoServerPort)
|
||||||
|
|
||||||
f.RunProcesses([]string{serverConf}, []string{clientConf})
|
f.RunProcesses([]string{serverConf}, []string{clientConf})
|
||||||
@@ -65,7 +65,7 @@ var _ = ginkgo.Describe("[Feature: Server Manager]", func() {
|
|||||||
framework.NewRequestExpect(f).PortName(tcpPortName).Ensure()
|
framework.NewRequestExpect(f).PortName(tcpPortName).Ensure()
|
||||||
|
|
||||||
// Not Allowed
|
// Not Allowed
|
||||||
framework.NewRequestExpect(f).Port(11001).ExpectError(true).Ensure()
|
framework.NewRequestExpect(f).Port(25001).ExpectError(true).Ensure()
|
||||||
|
|
||||||
// Unavailable, already bind by frps
|
// Unavailable, already bind by frps
|
||||||
framework.NewRequestExpect(f).PortName(consts.PortServerName).ExpectError(true).Ensure()
|
framework.NewRequestExpect(f).PortName(consts.PortServerName).ExpectError(true).Ensure()
|
||||||
@@ -76,7 +76,7 @@ var _ = ginkgo.Describe("[Feature: Server Manager]", func() {
|
|||||||
|
|
||||||
// Not Allowed
|
// Not Allowed
|
||||||
framework.NewRequestExpect(f).RequestModify(func(r *request.Request) {
|
framework.NewRequestExpect(f).RequestModify(func(r *request.Request) {
|
||||||
r.UDP().Port(11003)
|
r.UDP().Port(25003)
|
||||||
}).ExpectError(true).Ensure()
|
}).ExpectError(true).Ensure()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@@ -79,7 +79,6 @@ func (pa *Allocator) GetByName(portName string) int {
|
|||||||
udpConn.Close()
|
udpConn.Close()
|
||||||
|
|
||||||
pa.used.Insert(port)
|
pa.used.Insert(port)
|
||||||
pa.reserved.Delete(port)
|
|
||||||
return port
|
return port
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
|
@@ -23,14 +23,14 @@ var _ = ginkgo.Describe("[Feature: Server Manager]", func() {
|
|||||||
|
|
||||||
serverConf += `
|
serverConf += `
|
||||||
allowPorts = [
|
allowPorts = [
|
||||||
{ start = 10000, end = 11000 },
|
{ start = 20000, end = 25000 },
|
||||||
{ single = 11002 },
|
{ single = 25002 },
|
||||||
{ start = 12000, end = 13000 },
|
{ start = 30000, end = 50000 },
|
||||||
]
|
]
|
||||||
`
|
`
|
||||||
|
|
||||||
tcpPortName := port.GenName("TCP", port.WithRangePorts(10000, 11000))
|
tcpPortName := port.GenName("TCP", port.WithRangePorts(20000, 25000))
|
||||||
udpPortName := port.GenName("UDP", port.WithRangePorts(12000, 13000))
|
udpPortName := port.GenName("UDP", port.WithRangePorts(30000, 50000))
|
||||||
clientConf += fmt.Sprintf(`
|
clientConf += fmt.Sprintf(`
|
||||||
[[proxies]]
|
[[proxies]]
|
||||||
name = "tcp-allowded-in-range"
|
name = "tcp-allowded-in-range"
|
||||||
@@ -43,7 +43,7 @@ var _ = ginkgo.Describe("[Feature: Server Manager]", func() {
|
|||||||
name = "tcp-port-not-allowed"
|
name = "tcp-port-not-allowed"
|
||||||
type = "tcp"
|
type = "tcp"
|
||||||
localPort = {{ .%s }}
|
localPort = {{ .%s }}
|
||||||
remotePort = 11001
|
remotePort = 25001
|
||||||
`, framework.TCPEchoServerPort)
|
`, framework.TCPEchoServerPort)
|
||||||
clientConf += fmt.Sprintf(`
|
clientConf += fmt.Sprintf(`
|
||||||
[[proxies]]
|
[[proxies]]
|
||||||
@@ -64,7 +64,7 @@ var _ = ginkgo.Describe("[Feature: Server Manager]", func() {
|
|||||||
name = "udp-port-not-allowed"
|
name = "udp-port-not-allowed"
|
||||||
type = "udp"
|
type = "udp"
|
||||||
localPort = {{ .%s }}
|
localPort = {{ .%s }}
|
||||||
remotePort = 11003
|
remotePort = 25003
|
||||||
`, framework.UDPEchoServerPort)
|
`, framework.UDPEchoServerPort)
|
||||||
|
|
||||||
f.RunProcesses([]string{serverConf}, []string{clientConf})
|
f.RunProcesses([]string{serverConf}, []string{clientConf})
|
||||||
@@ -74,7 +74,7 @@ var _ = ginkgo.Describe("[Feature: Server Manager]", func() {
|
|||||||
framework.NewRequestExpect(f).PortName(tcpPortName).Ensure()
|
framework.NewRequestExpect(f).PortName(tcpPortName).Ensure()
|
||||||
|
|
||||||
// Not Allowed
|
// Not Allowed
|
||||||
framework.NewRequestExpect(f).Port(11001).ExpectError(true).Ensure()
|
framework.NewRequestExpect(f).Port(25001).ExpectError(true).Ensure()
|
||||||
|
|
||||||
// Unavailable, already bind by frps
|
// Unavailable, already bind by frps
|
||||||
framework.NewRequestExpect(f).PortName(consts.PortServerName).ExpectError(true).Ensure()
|
framework.NewRequestExpect(f).PortName(consts.PortServerName).ExpectError(true).Ensure()
|
||||||
@@ -85,7 +85,7 @@ var _ = ginkgo.Describe("[Feature: Server Manager]", func() {
|
|||||||
|
|
||||||
// Not Allowed
|
// Not Allowed
|
||||||
framework.NewRequestExpect(f).RequestModify(func(r *request.Request) {
|
framework.NewRequestExpect(f).RequestModify(func(r *request.Request) {
|
||||||
r.UDP().Port(11003)
|
r.UDP().Port(25003)
|
||||||
}).ExpectError(true).Ensure()
|
}).ExpectError(true).Ensure()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user