Add Coturn TURN server
This commit is contained in:
1 parent
752d0cf3af
commit
c3ca3e1752
13 files changed
+309
-11
No files matched your search
@@ -0,0 +1,12 @@
|
||||
import { randomBytes } from 'node:crypto';
|
||||
import { writeFile } from 'node:fs/promises';
|
||||
|
||||
try {
|
||||
await writeFile(new URL('../.env.development', import.meta.url),
|
||||
`# Local development only; shared by Compose and Vite.\nTURN_SECRET=${randomBytes(32).toString('hex')}\nTURN_HOST=127.0.0.1\nTURN_PORT=3478\nVITE_ICE_ENDPOINT=/api/ice-servers\nVITE_STUN_URL=stun:127.0.0.1:3478\n`,
|
||||
{ flag: 'wx', mode: 0o600 });
|
||||
console.log('Created .env.development with a private development TURN secret.');
|
||||
} catch (error) {
|
||||
if (error.code !== 'EEXIST') throw error;
|
||||
console.log('.env.development already exists; left unchanged. See .env.example for required settings.');
|
||||
}
|
||||
Reference in new issue
Block a user