Add openvpn and openconnect

This commit is contained in:
世界
2026-08-30 17:41:43 +08:00
parent 23ca3b415f
commit 2df7a9bac7
65 changed files with 12495 additions and 386 deletions
+21
View File
@@ -0,0 +1,21 @@
//go:build !linux
package openvpn
import "github.com/sagernet/sing/common"
const openVPNUDPSocketBufferSize = 7 << 20
type openVPNUDPSocketBufferSetter interface {
SetReadBuffer(bytes int) error
SetWriteBuffer(bytes int) error
}
func tuneOpenVPNUDPSocket(connection any) {
bufferSetter, loaded := common.Cast[openVPNUDPSocketBufferSetter](connection)
if !loaded {
return
}
_ = bufferSetter.SetReadBuffer(openVPNUDPSocketBufferSize)
_ = bufferSetter.SetWriteBuffer(openVPNUDPSocketBufferSize)
}