mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2025-02-24 13:12:26 +08:00
23 lines
291 B
Go
23 lines
291 B
Go
|
package tunnel
|
||
|
|
||
|
import (
|
||
|
"sync"
|
||
|
"time"
|
||
|
|
||
|
nat "github.com/Dreamacro/clash/component/nat-table"
|
||
|
)
|
||
|
|
||
|
var (
|
||
|
natTable *nat.Table
|
||
|
natOnce sync.Once
|
||
|
|
||
|
natTimeout = 120 * time.Second
|
||
|
)
|
||
|
|
||
|
func NATInstance() *nat.Table {
|
||
|
natOnce.Do(func() {
|
||
|
natTable = nat.New(natTimeout)
|
||
|
})
|
||
|
return natTable
|
||
|
}
|