mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-11 03:06:51 +02:00
* **New Features** * Multiplexed TLS port: HTTP API and a custom stream protocol can share one port via ALPN. * Agent-side TCP and DTLS/UDP stream tunneling with health-check support and runtime capability detection. * Agents now advertise per-agent stream support (TCP/UDP). * **Documentation** * Added comprehensive stream protocol documentation. * **Tests** * Extended integration and concurrency tests covering multiplexing, TCP/UDP streams, and health checks. * **Chores** * Compose/template updated to expose both TCP and UDP ports.
27 lines
586 B
Go
27 lines
586 B
Go
package stream_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
"github.com/yusing/godoxy/agent/pkg/agent/stream"
|
|
)
|
|
|
|
func TestTCPHealthCheck(t *testing.T) {
|
|
certs := genTestCerts(t)
|
|
|
|
srv := startTCPServer(t, certs)
|
|
|
|
err := stream.TCPHealthCheck(srv.Addr.String(), certs.CaCert, certs.ClientCert)
|
|
require.NoError(t, err, "health check")
|
|
}
|
|
|
|
func TestUDPHealthCheck(t *testing.T) {
|
|
certs := genTestCerts(t)
|
|
|
|
srv := startUDPServer(t, certs)
|
|
|
|
err := stream.UDPHealthCheck(srv.Addr.String(), certs.CaCert, certs.ClientCert)
|
|
require.NoError(t, err, "health check")
|
|
}
|