示例#1
0
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
}
示例#2
0
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
}
示例#3
0
package api

import (
	"v2ray.com/core/app"
)

const (
	APP_ID = app.ID(5)
)

type ApiServer struct {
}
示例#4
0
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{
示例#5
0
文件: web.go 项目: v2ray/v2ray-core
package web

import (
	"v2ray.com/core/app"
	"v2ray.com/core/common"
)

const (
	APP_ID = app.ID(8)
)

type WebServer interface {
	common.Releasable
	Handle()
}