From e72a7cb96fcc3c5e59bb76b01acc4eb36634ddee Mon Sep 17 00:00:00 2001 From: Shelikhoo Date: Sun, 12 Jun 2016 13:57:08 +0800 Subject: [PATCH] KCP: VMess will call setProxyCap to advertise KCP capacity on init --- proxy/vmess/inbound/inbound.go | 2 ++ proxy/vmess/outbound/outbound.go | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/proxy/vmess/inbound/inbound.go b/proxy/vmess/inbound/inbound.go index 2e5579f2d..e084da2ed 100644 --- a/proxy/vmess/inbound/inbound.go +++ b/proxy/vmess/inbound/inbound.go @@ -248,6 +248,8 @@ func init() { handler.inboundHandlerManager = space.GetApp(proxyman.APP_ID_INBOUND_MANAGER).(proxyman.InboundHandlerManager) } + handler.setProxyCap() + return handler, nil }) } diff --git a/proxy/vmess/outbound/outbound.go b/proxy/vmess/outbound/outbound.go index a06d95122..517f4f633 100644 --- a/proxy/vmess/outbound/outbound.go +++ b/proxy/vmess/outbound/outbound.go @@ -161,9 +161,14 @@ func init() { internal.MustRegisterOutboundHandlerCreator("vmess", func(space app.Space, rawConfig interface{}, meta *proxy.OutboundHandlerMeta) (proxy.OutboundHandler, error) { vOutConfig := rawConfig.(*Config) - return &VMessOutboundHandler{ + + handler := &VMessOutboundHandler{ receiverManager: NewReceiverManager(vOutConfig.Receivers), meta: meta, - }, nil + } + + handler.setProxyCap() + + return handler, nil }) }