Add loopback outound

This commit is contained in:
世界 2021-09-19 20:28:38 +08:00
parent 5c366db847
commit 707efd6d12
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
9 changed files with 310 additions and 1 deletions

View file

@ -2,7 +2,6 @@ package conf
import (
"encoding/json"
"github.com/golang/protobuf/proto"
"github.com/xtls/xray-core/common/serial"

15
infra/conf/loopback.go Normal file
View file

@ -0,0 +1,15 @@
package conf
import (
"github.com/golang/protobuf/proto"
"github.com/xtls/xray-core/proxy/loopback"
)
type LoopbackConfig struct {
InboundTag string `json:"inboundTag"`
}
func (l LoopbackConfig) Build() (proto.Message, error) {
return &loopback.Config{InboundTag: l.InboundTag}, nil
}

View file

@ -30,6 +30,7 @@ var (
outboundConfigLoader = NewJSONConfigLoader(ConfigCreatorCache{
"blackhole": func() interface{} { return new(BlackholeConfig) },
"loopback": func() interface{} { return new(LoopbackConfig) },
"freedom": func() interface{} { return new(FreedomConfig) },
"http": func() interface{} { return new(HTTPClientConfig) },
"shadowsocks": func() interface{} { return new(ShadowsocksClientConfig) },