1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-04-19 12:09:10 -04:00

organize handler metadata

This commit is contained in:
v2ray
2016-06-04 14:25:13 +02:00
parent 030fca10ba
commit 50ca869929
22 changed files with 153 additions and 138 deletions

View File

@@ -4,7 +4,6 @@ import (
"errors"
"github.com/v2ray/v2ray-core/app"
v2net "github.com/v2ray/v2ray-core/common/net"
"github.com/v2ray/v2ray-core/proxy"
"github.com/v2ray/v2ray-core/proxy/internal/config"
)
@@ -46,7 +45,7 @@ func MustRegisterOutboundHandlerCreator(name string, creator OutboundHandlerCrea
}
}
func CreateInboundHandler(name string, space app.Space, rawConfig []byte, listen v2net.Address, port v2net.Port) (proxy.InboundHandler, error) {
func CreateInboundHandler(name string, space app.Space, rawConfig []byte, meta *proxy.InboundHandlerMeta) (proxy.InboundHandler, error) {
creator, found := inboundFactories[name]
if !found {
return nil, ErrorProxyNotFound
@@ -56,12 +55,12 @@ func CreateInboundHandler(name string, space app.Space, rawConfig []byte, listen
if err != nil {
return nil, err
}
return creator(space, proxyConfig, listen, port)
return creator(space, proxyConfig, meta)
}
return creator(space, nil, listen, port)
return creator(space, nil, meta)
}
func CreateOutboundHandler(name string, space app.Space, rawConfig []byte, sendThrough v2net.Address) (proxy.OutboundHandler, error) {
func CreateOutboundHandler(name string, space app.Space, rawConfig []byte, meta *proxy.OutboundHandlerMeta) (proxy.OutboundHandler, error) {
creator, found := outboundFactories[name]
if !found {
return nil, ErrorNameExists
@@ -72,8 +71,8 @@ func CreateOutboundHandler(name string, space app.Space, rawConfig []byte, sendT
if err != nil {
return nil, err
}
return creator(space, proxyConfig, sendThrough)
return creator(space, proxyConfig, meta)
}
return creator(space, nil, sendThrough)
return creator(space, nil, meta)
}