diff --git a/web/assets/js/model/inbound.js b/web/assets/js/model/inbound.js
index c91dbd11..11ecb68e 100644
--- a/web/assets/js/model/inbound.js
+++ b/web/assets/js/model/inbound.js
@@ -1301,6 +1301,7 @@ class Inbound extends XrayCommonClass {
const security = forceTls == 'same' ? this.stream.security : forceTls;
const params = new Map();
params.set("type", this.stream.network);
+ params.set("encryption", this.settings.encryption);
switch (type) {
case "tcp":
const tcp = this.stream.tcp;
@@ -1859,13 +1860,15 @@ Inbound.VLESSSettings = class extends Inbound.Settings {
constructor(
protocol,
vlesses = [new Inbound.VLESSSettings.VLESS()],
- decryption = 'none',
+ decryption = "none",
fallbacks = []
) {
super(protocol);
this.vlesses = vlesses;
this.decryption = decryption;
this.fallbacks = fallbacks;
+ this.selectedAuth = "X25519, not Post-Quantum";
+ this.encryption = "";
}
addFallback() {
@@ -1876,22 +1879,42 @@ Inbound.VLESSSettings = class extends Inbound.Settings {
this.fallbacks.splice(index, 1);
}
- // decryption should be set to static value
static fromJson(json = {}) {
- return new Inbound.VLESSSettings(
+ const obj = new Inbound.VLESSSettings(
Protocols.VLESS,
- json.clients.map(client => Inbound.VLESSSettings.VLESS.fromJson(client)),
- json.decryption || 'none',
- Inbound.VLESSSettings.Fallback.fromJson(json.fallbacks),);
+ (json.clients || []).map(client => Inbound.VLESSSettings.VLESS.fromJson(client)),
+ json.decryption || "none",
+ Inbound.VLESSSettings.Fallback.fromJson(json.fallbacks || [])
+ );
+
+ obj.encryption = json.encryption || "";
+ obj.selectedAuth = json.selectedAuth || "X25519, not Post-Quantum";
+
+ return obj;
}
+
toJson() {
- return {
+ const json = {
clients: Inbound.VLESSSettings.toJsonArray(this.vlesses),
- decryption: this.decryption,
- fallbacks: Inbound.VLESSSettings.toJsonArray(this.fallbacks),
};
+
+ if (this.decryption) {
+ json.decryption = this.decryption;
+ }
+
+ if (this.encryption) {
+ json.encryption = this.encryption;
+ }
+
+ if (this.fallbacks && this.fallbacks.length > 0) {
+ json.fallbacks = Inbound.VLESSSettings.toJsonArray(this.fallbacks);
+ }
+
+ return json;
}
+
+
};
Inbound.VLESSSettings.VLESS = class extends XrayCommonClass {
diff --git a/web/controller/server.go b/web/controller/server.go
index f03c9ef2..08ecae1f 100644
--- a/web/controller/server.go
+++ b/web/controller/server.go
@@ -55,7 +55,7 @@ func (a *ServerController) initRouter(g *gin.RouterGroup) {
g.POST("/getNewX25519Cert", a.getNewX25519Cert)
g.POST("/getNewmldsa65", a.getNewmldsa65)
g.POST("/getNewEchCert", a.getNewEchCert)
- g.POST("/getNewmlkem768", a.getNewmlkem768)
+ g.POST("/getNewVlessEnc", a.getNewVlessEnc)
}
func (a *ServerController) refreshStatus() {
@@ -268,8 +268,8 @@ func (a *ServerController) getNewEchCert(c *gin.Context) {
jsonObj(c, cert, nil)
}
-func (a *ServerController) getNewmlkem768(c *gin.Context) {
- out, err := a.serverService.GetNewmlkem768()
+func (a *ServerController) getNewVlessEnc(c *gin.Context) {
+ out, err := a.serverService.GetNewVlessEnc()
if err != nil {
jsonMsg(c, I18nWeb(c, "pages.inbounds.toasts.getNewmlkem768Error"), err)
return
diff --git a/web/html/form/protocol/vless.html b/web/html/form/protocol/vless.html
index 3cebda6e..a0efa533 100644
--- a/web/html/form/protocol/vless.html
+++ b/web/html/form/protocol/vless.html
@@ -18,6 +18,26 @@
+
+
+
+
+ X25519 (not Post-Quantum)
+ ML-KEM-768 (Post-Quantum)
+
+
+
+
+
+
+
+
+
+ Get New keys
+
+
+
diff --git a/web/html/modals/inbound_modal.html b/web/html/modals/inbound_modal.html
index 2e50de8c..fcdea7bb 100644
--- a/web/html/modals/inbound_modal.html
+++ b/web/html/modals/inbound_modal.html
@@ -1,9 +1,7 @@
{{define "modals/inboundModal"}}
-
+
{{template "form/inbound"}}
-{{end}}
+{{end}}
\ No newline at end of file
diff --git a/web/service/server.go b/web/service/server.go
index d91ea027..eff7ff4f 100644
--- a/web/service/server.go
+++ b/web/service/server.go
@@ -872,28 +872,51 @@ func (s *ServerService) GetNewEchCert(sni string) (interface{}, error) {
}, nil
}
-func (s *ServerService) GetNewmlkem768() (any, error) {
- // Run the command
- cmd := exec.Command(xray.GetBinaryPath(), "mlkem768")
+type AuthBlock struct {
+ Label string `json:"label"`
+ Decryption string `json:"decryption"`
+ Encryption string `json:"encryption"`
+}
+
+func (s *ServerService) GetNewVlessEnc() (any, error) {
+ cmd := exec.Command(xray.GetBinaryPath(), "vlessenc")
var out bytes.Buffer
cmd.Stdout = &out
- err := cmd.Run()
- if err != nil {
+ if err := cmd.Run(); err != nil {
return nil, err
}
lines := strings.Split(out.String(), "\n")
- SeedLine := strings.Split(lines[0], ":")
- ClientLine := strings.Split(lines[1], ":")
+ var blocks []AuthBlock
+ var current *AuthBlock
- seed := strings.TrimSpace(SeedLine[1])
- client := strings.TrimSpace(ClientLine[1])
-
- keyPair := map[string]any{
- "seed": seed,
- "client": client,
+ for _, line := range lines {
+ line = strings.TrimSpace(line)
+ if strings.HasPrefix(line, "Authentication:") {
+ if current != nil {
+ blocks = append(blocks, *current)
+ }
+ current = &AuthBlock{Label: strings.TrimSpace(strings.TrimPrefix(line, "Authentication:"))}
+ } else if strings.HasPrefix(line, `"decryption"`) || strings.HasPrefix(line, `"encryption"`) {
+ parts := strings.SplitN(line, ":", 2)
+ if len(parts) == 2 && current != nil {
+ key := strings.Trim(parts[0], `" `)
+ val := strings.Trim(parts[1], `" `)
+ if key == "decryption" {
+ current.Decryption = val
+ } else if key == "encryption" {
+ current.Encryption = val
+ }
+ }
+ }
}
- return keyPair, nil
+ if current != nil {
+ blocks = append(blocks, *current)
+ }
+
+ return map[string]any{
+ "auths": blocks,
+ }, nil
}