Add clash persistence support

This commit is contained in:
世界 committed 2022-09-10 14:42:14 +08:00
1 parent 5297273937
commit 099358d3e5
8 files changed
+140 -19

No files matched your search

+7
View File
@@ -10,10 +10,17 @@ import (
type ClashServer interface {
Service
Mode() string
StoreSelected() bool
CacheFile() ClashCacheFile
RoutedConnection(ctx context.Context, conn net.Conn, metadata InboundContext, matchedRule Rule) (net.Conn, Tracker)
RoutedPacketConnection(ctx context.Context, conn N.PacketConn, metadata InboundContext, matchedRule Rule) (N.PacketConn, Tracker)
}
type ClashCacheFile interface {
LoadSelected(group string) string
StoreSelected(group string, selected string) error
}
type Tracker interface {
Leave()
}