package dispatcher import ( "v2ray.com/core/app" "v2ray.com/core/proxy" "v2ray.com/core/transport/ray" ) const ( APP_ID = app.ID(1) ) // PacketDispatcher dispatch a packet and possibly further network payload to its destination. type PacketDispatcher interface { DispatchToOutbound(meta *proxy.InboundHandlerMeta, session *proxy.SessionInfo) ray.InboundRay }
package dns import ( "net" "v2ray.com/core/app" ) const ( APP_ID = app.ID(2) ) // A DnsCache is an internal cache of DNS resolutions. type Server interface { Get(domain string) []net.IP }
package api import ( "v2ray.com/core/app" ) const ( APP_ID = app.ID(5) ) type ApiServer struct { }
package router import ( "errors" "v2ray.com/core/app" "v2ray.com/core/app/dns" "v2ray.com/core/common/loader" "v2ray.com/core/common/log" v2net "v2ray.com/core/common/net" "v2ray.com/core/proxy" ) const ( APP_ID = app.ID(3) ) var ( ErrInvalidRule = errors.New("Invalid Rule") ErrNoRuleApplicable = errors.New("No rule applicable") ) type Router struct { domainStrategy Config_DomainStrategy rules []Rule // cache *RoutingTable dnsServer dns.Server } func NewRouter(config *Config, space app.Space) *Router { r := &Router{
package web import ( "v2ray.com/core/app" "v2ray.com/core/common" ) const ( APP_ID = app.ID(8) ) type WebServer interface { common.Releasable Handle() }