mirror of
https://github.com/yusing/godoxy.git
synced 2026-01-11 21:10:30 +01: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.
25 lines
615 B
Go
25 lines
615 B
Go
package stream
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/pion/dtls/v3"
|
|
"github.com/yusing/goutils/synk"
|
|
)
|
|
|
|
const (
|
|
dialTimeout = 10 * time.Second
|
|
readDeadline = 10 * time.Second
|
|
)
|
|
|
|
// StreamALPN is the TLS ALPN protocol id used to multiplex the TCP stream tunnel
|
|
// and the HTTPS API on the same TCP port.
|
|
//
|
|
// When a client negotiates this ALPN, the agent will route the connection to the
|
|
// stream tunnel handler instead of the HTTP handler.
|
|
const StreamALPN = "godoxy-agent-stream/1"
|
|
|
|
var dTLSCipherSuites = []dtls.CipherSuiteID{dtls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256}
|
|
|
|
var sizedPool = synk.GetSizedBytesPool()
|