Add MTProxy, MASQUE, VPN, Link parser. Update AmneziaWG. Remove Tunneling

This commit is contained in:
Sergei Maklagin
2026-04-29 22:11:30 +03:00
parent 09f9f114aa
commit 04908a6a67
158 changed files with 7994 additions and 2277 deletions

View File

@@ -0,0 +1,34 @@
package masque
import "sync"
type NetBuffer struct {
capacity uint32
buf sync.Pool
}
func (n *NetBuffer) Get() []byte {
return *(n.buf.Get().(*[]byte))
}
func (n *NetBuffer) Put(buf []byte) {
if cap(buf) != int(n.capacity) {
return
}
n.buf.Put(&buf)
}
func NewNetBuffer(capacity uint32) *NetBuffer {
if capacity == 0 {
panic("capacity must be greater than 0")
}
return &NetBuffer{
capacity: capacity,
buf: sync.Pool{
New: func() interface{} {
b := make([]byte, capacity)
return &b
},
},
}
}