mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-02 02:14:16 +00:00
Refactor: GeoSite & GeoIP
This commit is contained in:
parent
8382b29922
commit
b11429eaee
54 changed files with 2110 additions and 1633 deletions
|
@ -9,6 +9,7 @@ import (
|
|||
"github.com/xtls/xray-core/app/proxyman"
|
||||
"github.com/xtls/xray-core/app/router"
|
||||
"github.com/xtls/xray-core/common"
|
||||
"github.com/xtls/xray-core/common/matcher/geoip"
|
||||
"github.com/xtls/xray-core/common/net"
|
||||
"github.com/xtls/xray-core/common/serial"
|
||||
"github.com/xtls/xray-core/core"
|
||||
|
@ -39,7 +40,7 @@ func TestResolveIP(t *testing.T) {
|
|||
DomainStrategy: router.Config_IpIfNonMatch,
|
||||
Rule: []*router.RoutingRule{
|
||||
{
|
||||
Cidr: []*router.CIDR{
|
||||
Cidr: []*geoip.CIDR{
|
||||
{
|
||||
Ip: []byte{127, 0, 0, 0},
|
||||
Prefix: 8,
|
||||
|
|
|
@ -13,6 +13,7 @@ import (
|
|||
"github.com/xtls/xray-core/app/router"
|
||||
"github.com/xtls/xray-core/common"
|
||||
clog "github.com/xtls/xray-core/common/log"
|
||||
"github.com/xtls/xray-core/common/matcher/domain"
|
||||
"github.com/xtls/xray-core/common/net"
|
||||
"github.com/xtls/xray-core/common/protocol"
|
||||
"github.com/xtls/xray-core/common/serial"
|
||||
|
@ -53,8 +54,8 @@ func TestReverseProxy(t *testing.T) {
|
|||
serial.ToTypedMessage(&router.Config{
|
||||
Rule: []*router.RoutingRule{
|
||||
{
|
||||
Domain: []*router.Domain{
|
||||
{Type: router.Domain_Full, Value: "test.example.com"},
|
||||
Domain: []*domain.Domain{
|
||||
{Type: domain.MatchingType_Full, Value: "test.example.com"},
|
||||
},
|
||||
TargetTag: &router.RoutingRule_Tag{
|
||||
Tag: "portal",
|
||||
|
@ -122,8 +123,8 @@ func TestReverseProxy(t *testing.T) {
|
|||
serial.ToTypedMessage(&router.Config{
|
||||
Rule: []*router.RoutingRule{
|
||||
{
|
||||
Domain: []*router.Domain{
|
||||
{Type: router.Domain_Full, Value: "test.example.com"},
|
||||
Domain: []*domain.Domain{
|
||||
{Type: domain.MatchingType_Full, Value: "test.example.com"},
|
||||
},
|
||||
TargetTag: &router.RoutingRule_Tag{
|
||||
Tag: "reverse",
|
||||
|
@ -238,8 +239,8 @@ func TestReverseProxyLongRunning(t *testing.T) {
|
|||
serial.ToTypedMessage(&router.Config{
|
||||
Rule: []*router.RoutingRule{
|
||||
{
|
||||
Domain: []*router.Domain{
|
||||
{Type: router.Domain_Full, Value: "test.example.com"},
|
||||
Domain: []*domain.Domain{
|
||||
{Type: domain.MatchingType_Full, Value: "test.example.com"},
|
||||
},
|
||||
TargetTag: &router.RoutingRule_Tag{
|
||||
Tag: "portal",
|
||||
|
@ -321,8 +322,8 @@ func TestReverseProxyLongRunning(t *testing.T) {
|
|||
serial.ToTypedMessage(&router.Config{
|
||||
Rule: []*router.RoutingRule{
|
||||
{
|
||||
Domain: []*router.Domain{
|
||||
{Type: router.Domain_Full, Value: "test.example.com"},
|
||||
Domain: []*domain.Domain{
|
||||
{Type: domain.MatchingType_Full, Value: "test.example.com"},
|
||||
},
|
||||
TargetTag: &router.RoutingRule_Tag{
|
||||
Tag: "reverse",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue