You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-8Lines changed: 17 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,9 @@ depends on git and go.
42
42
43
43
By default, the build script does not clone [Xray-core](https://github.com/XTLS/Xray-core). It uses Go modules and pins Xray-core to tag `v26.6.27` (recorded by Go as the matching pseudo-version).
44
44
Pass the optional `local` argument to use an existing local checkout at `../Xray-core` through a Go module `replace`.
45
-
Linux and Windows builds only produce the libXray shared library. Applications that need a standalone Xray executable should use official Xray-core release binaries.
45
+
Linux and Windows builds also produce a small desktop wrapper executable:
46
+
`bin/xray` or `bin/xray.exe`. The wrapper accepts `-configPath` pointing to a
47
+
`LibXrayInvokeRequest` JSON file whose method is `runXray`.
46
48
47
49
### Usage
48
50
@@ -130,6 +132,11 @@ The request is a JSON object:
130
132
{
131
133
"apiVersion": 1,
132
134
"method": "runXray",
135
+
"env": {
136
+
"xray.location.asset": "/path/to/dat",
137
+
"xray.location.cert": "/path/to/dat",
138
+
"xray.tun.fd": "123"
139
+
},
133
140
"payload": {
134
141
"configPath": "/path/to/config.json"
135
142
}
@@ -148,14 +155,16 @@ The response is a JSON object:
148
155
149
156
Design notes:
150
157
151
-
1.`Invoke` does not accept an `env` field. Runtime Xray-core environment
152
-
settings must be written into the Xray config root `env` object.
153
-
2.`xray.json.strict`, `xray.location.config`, and `xray.location.confdir` are
158
+
1.`Invoke.env` supports only fixed Xray-core runtime environment keys:
159
+
`xray.location.asset`, `xray.location.cert`, and `xray.tun.fd`.
160
+
2. Non-empty `env` fields are set on the process before the method runs.
161
+
Missing fields are not unset and old values are not restored.
162
+
3.`xray.json.strict`, `xray.location.config`, and `xray.location.confdir` are
154
163
load-stage process environment variables and cannot be supplied through
155
-
`Invoke`.
156
-
3.`SetTunFd` has been removed. Write `xray.tun.fd` into the Xray config root
157
-
`env` object before calling `runXray` when the fd is only known at runtime.
158
-
4.`countGeoData` is not backed by an Xray config, so its `datDir` is passed in
164
+
`Invoke.env`.
165
+
4.`SetTunFd` has been removed. Use `Invoke.env["xray.tun.fd"]` when the fd is
166
+
only known at runtime.
167
+
5.`countGeoData` is not backed by an Xray config, so its `datDir` is passed in
0 commit comments