mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-25 07:20:44 +00:00
organize handler metadata
This commit is contained in:
1 parent
030fca10ba
commit
50ca869929
22 files changed
+153
-138
No files matched your search
+13
-3
@@ -91,7 +91,11 @@ func NewPoint(pConfig *Config) (*Point, error) {
|
||||
vpoint.space.BindApp(dispatcher.APP_ID, dispatchers.NewDefaultDispatcher(vpoint.space))
|
||||
|
||||
ichConfig := pConfig.InboundConfig.Settings
|
||||
ich, err := proxyrepo.CreateInboundHandler(pConfig.InboundConfig.Protocol, vpoint.space, ichConfig, pConfig.InboundConfig.ListenOn, vpoint.port)
|
||||
ich, err := proxyrepo.CreateInboundHandler(
|
||||
pConfig.InboundConfig.Protocol, vpoint.space, ichConfig, &proxy.InboundHandlerMeta{
|
||||
Tag: "system.inbound",
|
||||
Address: pConfig.InboundConfig.ListenOn,
|
||||
Port: vpoint.port})
|
||||
if err != nil {
|
||||
log.Error("Failed to create inbound connection handler: ", err)
|
||||
return nil, err
|
||||
@@ -99,7 +103,10 @@ func NewPoint(pConfig *Config) (*Point, error) {
|
||||
vpoint.ich = ich
|
||||
|
||||
ochConfig := pConfig.OutboundConfig.Settings
|
||||
och, err := proxyrepo.CreateOutboundHandler(pConfig.OutboundConfig.Protocol, vpoint.space, ochConfig, pConfig.OutboundConfig.SendThrough)
|
||||
och, err := proxyrepo.CreateOutboundHandler(
|
||||
pConfig.OutboundConfig.Protocol, vpoint.space, ochConfig, &proxy.OutboundHandlerMeta{
|
||||
Tag: "system.outbound",
|
||||
Address: pConfig.OutboundConfig.SendThrough})
|
||||
if err != nil {
|
||||
log.Error("Failed to create outbound connection handler: ", err)
|
||||
return nil, err
|
||||
@@ -144,7 +151,10 @@ func NewPoint(pConfig *Config) (*Point, error) {
|
||||
if len(outboundDetours) > 0 {
|
||||
vpoint.odh = make(map[string]proxy.OutboundHandler)
|
||||
for _, detourConfig := range outboundDetours {
|
||||
detourHandler, err := proxyrepo.CreateOutboundHandler(detourConfig.Protocol, vpoint.space, detourConfig.Settings, detourConfig.SendThrough)
|
||||
detourHandler, err := proxyrepo.CreateOutboundHandler(
|
||||
detourConfig.Protocol, vpoint.space, detourConfig.Settings, &proxy.OutboundHandlerMeta{
|
||||
Tag: detourConfig.Tag,
|
||||
Address: detourConfig.SendThrough})
|
||||
if err != nil {
|
||||
log.Error("Point: Failed to create detour outbound connection handler: ", err)
|
||||
return nil, err
|
||||
|
||||
Reference in new issue
Block a user