fix(qr): Wrap X-Ray config in 'config' field inside last_config
Amnezia Android expects the contents of 'last_config' to be a JSON object containing a 'config' field which holds the actual protocol configuration string. Previously we were putting the configuration directly into 'last_config', which caused the import to fail.
This commit is contained in:
+2
-1
@@ -462,7 +462,8 @@ class QrUtil
|
|||||||
[
|
[
|
||||||
'container' => 'amnezia-xray',
|
'container' => 'amnezia-xray',
|
||||||
'xray' => [
|
'xray' => [
|
||||||
'last_config' => json_encode($clientCfg, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT),
|
// X-Ray config must be wrapped in a "config" field inside the last_config JSON
|
||||||
|
'last_config' => json_encode(['config' => json_encode($clientCfg, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT)], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
|
||||||
'port' => (string) $port,
|
'port' => (string) $port,
|
||||||
'transport_proto' => 'tcp'
|
'transport_proto' => 'tcp'
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user