mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-11 06:38:41 +00:00
feat: add loopback outbound
Co-authored-by: Shelikhoo <xiaokangwang@outlook.com>
This commit is contained in:
parent
9dec65e367
commit
98050aaf02
7 changed files with 315 additions and 1 deletions
14
infra/conf/loopback.go
Normal file
14
infra/conf/loopback.go
Normal file
|
@ -0,0 +1,14 @@
|
|||
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
|
||||
}
|
|
@ -2,11 +2,12 @@ package conf
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/xtls/xray-core/transport/internet"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/xtls/xray-core/transport/internet"
|
||||
|
||||
"github.com/xtls/xray-core/app/dispatcher"
|
||||
"github.com/xtls/xray-core/app/proxyman"
|
||||
"github.com/xtls/xray-core/app/stats"
|
||||
|
@ -38,6 +39,7 @@ var (
|
|||
"trojan": func() interface{} { return new(TrojanClientConfig) },
|
||||
"mtproto": func() interface{} { return new(MTProtoClientConfig) },
|
||||
"dns": func() interface{} { return new(DNSOutboundConfig) },
|
||||
"loopback": func() interface{} { return new(LoopbackConfig) },
|
||||
}, "protocol", "settings")
|
||||
|
||||
ctllog = log.New(os.Stderr, "xctl> ", 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue