mirror of
https://github.com/SagerNet/sing-tun.git
synced 2025-04-03 20:07:40 +03:00
Add auto-redirect
This commit is contained in:
parent
ad763519ff
commit
67a5b408ef
9 changed files with 944 additions and 10 deletions
22
redirect.go
Normal file
22
redirect.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package tun
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/sagernet/sing/common/logger"
|
||||
)
|
||||
|
||||
type AutoRedirect interface {
|
||||
Start() error
|
||||
Close() error
|
||||
}
|
||||
|
||||
type AutoRedirectOptions struct {
|
||||
TunOptions *Options
|
||||
Context context.Context
|
||||
Handler Handler
|
||||
Logger logger.Logger
|
||||
TableName string
|
||||
DisableNFTables bool
|
||||
CustomRedirectPort func() int
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue