|  | @@ -8,6 +8,7 @@ import (
 | 
											
												
													
														|  |  	"github.com/v2ray/v2ray-core/common/alloc"
 |  |  	"github.com/v2ray/v2ray-core/common/alloc"
 | 
											
												
													
														|  |  	"github.com/v2ray/v2ray-core/common/log"
 |  |  	"github.com/v2ray/v2ray-core/common/log"
 | 
											
												
													
														|  |  	v2net "github.com/v2ray/v2ray-core/common/net"
 |  |  	v2net "github.com/v2ray/v2ray-core/common/net"
 | 
											
												
													
														|  | 
 |  | +	"github.com/v2ray/v2ray-core/proxy"
 | 
											
												
													
														|  |  	"github.com/v2ray/v2ray-core/transport/ray"
 |  |  	"github.com/v2ray/v2ray-core/transport/ray"
 | 
											
												
													
														|  |  )
 |  |  )
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -95,12 +96,14 @@ type UDPServer struct {
 | 
											
												
													
														|  |  	sync.RWMutex
 |  |  	sync.RWMutex
 | 
											
												
													
														|  |  	conns            map[string]*TimedInboundRay
 |  |  	conns            map[string]*TimedInboundRay
 | 
											
												
													
														|  |  	packetDispatcher dispatcher.PacketDispatcher
 |  |  	packetDispatcher dispatcher.PacketDispatcher
 | 
											
												
													
														|  | 
 |  | +	meta             *proxy.InboundHandlerMeta
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -func NewUDPServer(packetDispatcher dispatcher.PacketDispatcher) *UDPServer {
 |  | 
 | 
											
												
													
														|  | 
 |  | +func NewUDPServer(meta *proxy.InboundHandlerMeta, packetDispatcher dispatcher.PacketDispatcher) *UDPServer {
 | 
											
												
													
														|  |  	return &UDPServer{
 |  |  	return &UDPServer{
 | 
											
												
													
														|  |  		conns:            make(map[string]*TimedInboundRay),
 |  |  		conns:            make(map[string]*TimedInboundRay),
 | 
											
												
													
														|  |  		packetDispatcher: packetDispatcher,
 |  |  		packetDispatcher: packetDispatcher,
 | 
											
												
													
														|  | 
 |  | +		meta:             meta,
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -137,7 +140,7 @@ func (this *UDPServer) Dispatch(source v2net.Destination, destination v2net.Dest
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  	log.Info("UDP Server: establishing new connection for ", destString)
 |  |  	log.Info("UDP Server: establishing new connection for ", destString)
 | 
											
												
													
														|  | -	inboundRay := this.packetDispatcher.DispatchToOutbound(destination)
 |  | 
 | 
											
												
													
														|  | 
 |  | +	inboundRay := this.packetDispatcher.DispatchToOutbound(this.meta, destination)
 | 
											
												
													
														|  |  	timedInboundRay := NewTimedInboundRay(destString, inboundRay, this)
 |  |  	timedInboundRay := NewTimedInboundRay(destString, inboundRay, this)
 | 
											
												
													
														|  |  	outputStream := timedInboundRay.InboundInput()
 |  |  	outputStream := timedInboundRay.InboundInput()
 | 
											
												
													
														|  |  	if outputStream != nil {
 |  |  	if outputStream != nil {
 |