mirror of https://github.com/v2ray/v2ray-core
completely fix detour config
parent
957eaf38db
commit
9713bf9adf
|
@ -6,9 +6,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func (this *VMessInboundHandler) generateCommand(request *protocol.RequestHeader) protocol.ResponseCommand {
|
func (this *VMessInboundHandler) generateCommand(request *protocol.RequestHeader) protocol.ResponseCommand {
|
||||||
if this.features != nil && this.features.Detour != nil {
|
if this.detours != nil {
|
||||||
|
tag := this.detours.ToTag
|
||||||
tag := this.features.Detour.ToTag
|
|
||||||
if this.inboundHandlerManager != nil {
|
if this.inboundHandlerManager != nil {
|
||||||
handler, availableMin := this.inboundHandlerManager.GetHandler(tag)
|
handler, availableMin := this.inboundHandlerManager.GetHandler(tag)
|
||||||
inboundHandler, ok := handler.(*VMessInboundHandler)
|
inboundHandler, ok := handler.(*VMessInboundHandler)
|
||||||
|
|
|
@ -72,7 +72,7 @@ type VMessInboundHandler struct {
|
||||||
usersByEmail *userByEmail
|
usersByEmail *userByEmail
|
||||||
accepting bool
|
accepting bool
|
||||||
listener *hub.TCPHub
|
listener *hub.TCPHub
|
||||||
features *FeaturesConfig
|
detours *DetourConfig
|
||||||
listeningPort v2net.Port
|
listeningPort v2net.Port
|
||||||
listeningAddress v2net.Address
|
listeningAddress v2net.Address
|
||||||
}
|
}
|
||||||
|
@ -232,7 +232,7 @@ func init() {
|
||||||
handler := &VMessInboundHandler{
|
handler := &VMessInboundHandler{
|
||||||
packetDispatcher: space.GetApp(dispatcher.APP_ID).(dispatcher.PacketDispatcher),
|
packetDispatcher: space.GetApp(dispatcher.APP_ID).(dispatcher.PacketDispatcher),
|
||||||
clients: allowedClients,
|
clients: allowedClients,
|
||||||
features: config.Features,
|
detours: config.DetourConfig,
|
||||||
usersByEmail: NewUserByEmail(config.AllowedUsers, config.Defaults),
|
usersByEmail: NewUserByEmail(config.AllowedUsers, config.Defaults),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,7 @@ func NewPoint(pConfig *Config) (*Point, error) {
|
||||||
for _, detourConfig := range outboundDetours {
|
for _, detourConfig := range outboundDetours {
|
||||||
detourHandler, err := proxyrepo.CreateOutboundHandler(detourConfig.Protocol, vpoint.space, detourConfig.Settings)
|
detourHandler, err := proxyrepo.CreateOutboundHandler(detourConfig.Protocol, vpoint.space, detourConfig.Settings)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Failed to create detour outbound connection handler: ", err)
|
log.Error("Point: Failed to create detour outbound connection handler: ", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
vpoint.odh[detourConfig.Tag] = detourHandler
|
vpoint.odh[detourConfig.Tag] = detourHandler
|
||||||
|
@ -164,7 +164,7 @@ func (this *Point) Close() {
|
||||||
// In the case of any errors, the state of the server is unpredicatable.
|
// In the case of any errors, the state of the server is unpredicatable.
|
||||||
func (this *Point) Start() error {
|
func (this *Point) Start() error {
|
||||||
if this.port <= 0 {
|
if this.port <= 0 {
|
||||||
log.Error("Invalid port ", this.port)
|
log.Error("Point: Invalid port ", this.port)
|
||||||
return ErrorBadConfiguration
|
return ErrorBadConfiguration
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ func (this *Point) Start() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.Warning("Point server started on port ", this.port)
|
log.Warning("Point: started on port ", this.port)
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue