Browse Source

fix: VLESS simplified config inbound user account

秋のかえで 4 years ago
parent
commit
a8ff0a6371

+ 1 - 1
proxy/vless/inbound/config.proto

@@ -25,7 +25,7 @@ message Config {
   repeated Fallback fallbacks = 3;
   repeated Fallback fallbacks = 3;
 }
 }
 
 
-message SimplifiedConfig{
+message SimplifiedConfig {
   option (v2ray.core.common.protoext.message_opt).type = "inbound";
   option (v2ray.core.common.protoext.message_opt).type = "inbound";
   option (v2ray.core.common.protoext.message_opt).short_name = "vless";
   option (v2ray.core.common.protoext.message_opt).short_name = "vless";
 
 

+ 2 - 9
proxy/vless/inbound/inbound.go

@@ -54,17 +54,10 @@ func init() {
 				}
 				}
 				return
 				return
 			}(),
 			}(),
+			Decryption: "none",
 		}
 		}
 
 
-		var dc dns.Client
-		if err := core.RequireFeatures(ctx, func(d dns.Client) error {
-			dc = d
-			return nil
-		}); err != nil {
-			return nil, err
-		}
-
-		return New(ctx, fullConfig, dc)
+		return common.CreateObject(ctx, fullConfig)
 	}))
 	}))
 }
 }
 
 

+ 4 - 5
proxy/vless/outbound/outbound.go

@@ -17,9 +17,8 @@ import (
 	"github.com/v2fly/v2ray-core/v4/common/signal"
 	"github.com/v2fly/v2ray-core/v4/common/signal"
 	"github.com/v2fly/v2ray-core/v4/common/task"
 	"github.com/v2fly/v2ray-core/v4/common/task"
 	"github.com/v2fly/v2ray-core/v4/features/policy"
 	"github.com/v2fly/v2ray-core/v4/features/policy"
-	"github.com/v2fly/v2ray-core/v4/proxy/vless"
-	"github.com/v2fly/v2ray-core/v4/proxy/vless/encoding"
-	"github.com/v2fly/v2ray-core/v4/proxy/vmess"
+	"github.com/v2fly/v2ray-core/v4/protocol/vless"
+	"github.com/v2fly/v2ray-core/v4/protocol/vless/encoding"
 	"github.com/v2fly/v2ray-core/v4/transport"
 	"github.com/v2fly/v2ray-core/v4/transport"
 	"github.com/v2fly/v2ray-core/v4/transport/internet"
 	"github.com/v2fly/v2ray-core/v4/transport/internet"
 )
 )
@@ -37,13 +36,13 @@ func init() {
 				Port:    simplifiedClient.Port,
 				Port:    simplifiedClient.Port,
 				User: []*protocol.User{
 				User: []*protocol.User{
 					{
 					{
-						Account: serial.ToTypedMessage(&vmess.Account{Id: simplifiedClient.Uuid}),
+						Account: serial.ToTypedMessage(&vless.Account{Id: simplifiedClient.Uuid, Encryption: "none"}),
 					},
 					},
 				},
 				},
 			},
 			},
 		}}
 		}}
 
 
-		return New(ctx, fullClient)
+		return common.CreateObject(ctx, fullClient)
 	}))
 	}))
 }
 }