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
24 lines
292 B
Go
24 lines
292 B
Go
package protocol
|
|
|
|
import (
|
|
"sync"
|
|
)
|
|
|
|
type SafeFrame struct {
|
|
*Frame
|
|
once sync.Once
|
|
}
|
|
|
|
func (sf *SafeFrame) Close() error {
|
|
sf.once.Do(func() {
|
|
if sf.Frame != nil {
|
|
sf.Frame.Release()
|
|
}
|
|
})
|
|
return nil
|
|
}
|
|
|
|
func WithFrame(frame *Frame) *SafeFrame {
|
|
return &SafeFrame{Frame: frame}
|
|
}
|