mirror of
https://github.com/Gouryella/drip.git
synced 2026-02-23 21:00:44 +00:00
- Introduce pooled tunnel sessions (TunnelID/DataConnect) on client/server - Proxy HTTP/HTTPS via raw HTTP over yamux streams; pipe TCP streams directly - Move UI/stats into internal/shared; refactor CLI tunnel helpers; drop msgpack/hpack legacy
25 lines
489 B
Go
25 lines
489 B
Go
package protocol
|
|
|
|
import (
|
|
"sync/atomic"
|
|
)
|
|
|
|
// AdaptivePoolManager tracks active connections for load monitoring
|
|
type AdaptivePoolManager struct {
|
|
activeConnections atomic.Int64
|
|
}
|
|
|
|
var globalAdaptiveManager = &AdaptivePoolManager{}
|
|
|
|
func RegisterConnection() {
|
|
globalAdaptiveManager.activeConnections.Add(1)
|
|
}
|
|
|
|
func UnregisterConnection() {
|
|
globalAdaptiveManager.activeConnections.Add(-1)
|
|
}
|
|
|
|
func GetActiveConnections() int64 {
|
|
return globalAdaptiveManager.activeConnections.Load()
|
|
}
|