You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
v2ray-core/app/router/router.go

25 lines
471 B

9 years ago
package router
import (
"github.com/v2ray/v2ray-core/app/point/config"
9 years ago
v2net "github.com/v2ray/v2ray-core/common/net"
)
type Router interface {
TakeDetour(v2net.Packet) (config.ConnectionTag, error)
}
type RouterFactory interface {
Create(rawConfig interface{}) (Router, error)
}
var (
routerCache = make(map[string]RouterFactory)
)
func RegisterRouter(name string, factory RouterFactory) error {
// TODO: check name
routerCache[name] = factory
return nil
}