mirror of https://github.com/fatedier/frp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.1 KiB
48 lines
1.1 KiB
3 years ago
|
package features
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"time"
|
||
|
|
||
2 years ago
|
"github.com/onsi/ginkgo/v2"
|
||
3 years ago
|
|
||
2 years ago
|
"github.com/fatedier/frp/test/e2e/framework"
|
||
3 years ago
|
)
|
||
|
|
||
2 years ago
|
var _ = ginkgo.Describe("[Feature: Heartbeat]", func() {
|
||
3 years ago
|
f := framework.NewDefaultFramework()
|
||
|
|
||
2 years ago
|
ginkgo.It("disable application layer heartbeat", func() {
|
||
3 years ago
|
serverPort := f.AllocPort()
|
||
|
serverConf := fmt.Sprintf(`
|
||
1 year ago
|
bindAddr = "0.0.0.0"
|
||
|
bindPort = %d
|
||
|
transport.heartbeatTimeout = -1
|
||
|
transport.tcpMuxKeepaliveInterval = 2
|
||
3 years ago
|
`, serverPort)
|
||
|
|
||
|
remotePort := f.AllocPort()
|
||
|
clientConf := fmt.Sprintf(`
|
||
1 year ago
|
serverPort = %d
|
||
|
log.level = "trace"
|
||
|
transport.heartbeatInterval = -1
|
||
|
transport.heartbeatTimeout = -1
|
||
|
transport.tcpMuxKeepaliveInterval = 2
|
||
|
|
||
|
[[proxies]]
|
||
|
name = "tcp"
|
||
|
type = "tcp"
|
||
|
localPort = %d
|
||
|
remotePort = %d
|
||
3 years ago
|
`, serverPort, f.PortByName(framework.TCPEchoServerPort), remotePort)
|
||
|
|
||
|
// run frps and frpc
|
||
|
f.RunProcesses([]string{serverConf}, []string{clientConf})
|
||
|
|
||
|
framework.NewRequestExpect(f).Protocol("tcp").Port(remotePort).Ensure()
|
||
|
|
||
|
time.Sleep(5 * time.Second)
|
||
|
framework.NewRequestExpect(f).Protocol("tcp").Port(remotePort).Ensure()
|
||
|
})
|
||
|
})
|