tturn 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/README.zh-CN.md +1 -1
- package/dist/app.js +5 -4
- package/dist/cli.js +6 -1
- package/index.node +0 -0
- package/package.json +1 -1
- package/tturn.win32-x64-msvc.node +0 -0
package/README.md
CHANGED
|
@@ -93,6 +93,8 @@ Optional env:
|
|
|
93
93
|
|
|
94
94
|
- `TURN_PUBLIC_IP`
|
|
95
95
|
- `TURN_PORT`
|
|
96
|
+
- `TURN_MIN_PORT`
|
|
97
|
+
- `TURN_MAX_PORT`
|
|
96
98
|
- `TTURN_TTL_SEC`
|
|
97
99
|
- `TTURN_USER_ID`
|
|
98
100
|
- `TTURN_USERNAME` (or `TURN_USERNAME`)
|
|
@@ -109,7 +111,7 @@ Optional env:
|
|
|
109
111
|
- `username` / `userId` (optional): default credential username seed. `username` has higher priority.
|
|
110
112
|
- `ttlSec` (optional): default credential TTL used by `start()` and `issueCredential()`.
|
|
111
113
|
- `disableCredentialExpiry` (optional): disable timestamp expiry check and issue non-expiring credentials.
|
|
112
|
-
- `minPort` / `maxPort`:
|
|
114
|
+
- `minPort` / `maxPort`: relay allocation port range (effective in native TURN allocator).
|
|
113
115
|
|
|
114
116
|
At least one of `authSecret` or `password` must be provided.
|
|
115
117
|
|
package/README.zh-CN.md
CHANGED
|
@@ -92,7 +92,7 @@ TURN_REALM=turn.example.com TURN_USERNAME=alice TURN_PASSWORD=alice-pass TTURN_D
|
|
|
92
92
|
- `username` / `userId`(可选):默认凭证用户名种子,`username` 优先级更高。
|
|
93
93
|
- `ttlSec`(可选):`start()` 与 `issueCredential()` 的默认凭证时效。
|
|
94
94
|
- `disableCredentialExpiry`(可选):禁用时间戳过期校验,生成不过期凭证。
|
|
95
|
-
- `minPort` / `maxPort
|
|
95
|
+
- `minPort` / `maxPort`:中继分配端口范围(已在 native TURN 分配器中生效)。
|
|
96
96
|
|
|
97
97
|
`authSecret` 和 `password` 至少需要提供一个。
|
|
98
98
|
|
package/dist/app.js
CHANGED
|
@@ -3,10 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const index_1 = require("./index");
|
|
4
4
|
const APP_CONFIG = {
|
|
5
5
|
realm: "turn.example.com",
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
authSecret: "",
|
|
7
|
+
password: "replace-with-your-password",
|
|
8
|
+
publicIp: "1.2.3.4",
|
|
9
|
+
listenPort: 3478,
|
|
10
|
+
username: "google-test",
|
|
10
11
|
ttlSec: 600,
|
|
11
12
|
disableCredentialExpiry: true
|
|
12
13
|
};
|
package/dist/cli.js
CHANGED
|
@@ -12,6 +12,9 @@ async function run() {
|
|
|
12
12
|
authSecret: authOptions.authSecret,
|
|
13
13
|
password: authOptions.password,
|
|
14
14
|
publicIp: process.env.TURN_PUBLIC_IP,
|
|
15
|
+
listenPort: process.env.TURN_PORT ? Number(process.env.TURN_PORT) : 3478,
|
|
16
|
+
minPort: process.env.TURN_MIN_PORT ? Number(process.env.TURN_MIN_PORT) : undefined,
|
|
17
|
+
maxPort: process.env.TURN_MAX_PORT ? Number(process.env.TURN_MAX_PORT) : undefined,
|
|
15
18
|
disableCredentialExpiry: readBoolEnv("TTURN_DISABLE_CREDENTIAL_EXPIRY") ?? Boolean(authOptions.password)
|
|
16
19
|
});
|
|
17
20
|
const ice = service.issueCredential({
|
|
@@ -31,6 +34,8 @@ async function run() {
|
|
|
31
34
|
password: authOptions.password,
|
|
32
35
|
publicIp: process.env.TURN_PUBLIC_IP,
|
|
33
36
|
listenPort: process.env.TURN_PORT ? Number(process.env.TURN_PORT) : 3478,
|
|
37
|
+
minPort: process.env.TURN_MIN_PORT ? Number(process.env.TURN_MIN_PORT) : undefined,
|
|
38
|
+
maxPort: process.env.TURN_MAX_PORT ? Number(process.env.TURN_MAX_PORT) : undefined,
|
|
34
39
|
ttlSec: process.env.TTURN_TTL_SEC ? Number(process.env.TTURN_TTL_SEC) : 3600,
|
|
35
40
|
username: readUsernameEnv(),
|
|
36
41
|
userId: process.env.TTURN_USER_ID,
|
|
@@ -64,7 +69,7 @@ function printUsage() {
|
|
|
64
69
|
" TURN_REALM",
|
|
65
70
|
" TURN_SECRET or TURN_PASSWORD",
|
|
66
71
|
"optional env:",
|
|
67
|
-
" TURN_PUBLIC_IP, TURN_PORT, TTURN_TTL_SEC, TTURN_USER_ID, TTURN_USERNAME (or TURN_USERNAME), TTURN_DISABLE_CREDENTIAL_EXPIRY"
|
|
72
|
+
" TURN_PUBLIC_IP, TURN_PORT, TURN_MIN_PORT, TURN_MAX_PORT, TTURN_TTL_SEC, TTURN_USER_ID, TTURN_USERNAME (or TURN_USERNAME), TTURN_DISABLE_CREDENTIAL_EXPIRY"
|
|
68
73
|
].join("\n") + "\n");
|
|
69
74
|
}
|
|
70
75
|
function readUsernameEnv() {
|
package/index.node
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|