Hiding ICE Servers connections

Does anyone know how to properly avoid exposing my TURN server in the client or is it unavoidable? My first thought was to store it in my .env but in the end I still call it in a page so I am confused right now. Another thing that I saw was to get it from an api route but then I would need temporary username and credential which I still don't know how to implement. My TURN server is currently in AWS EC2 and everything seems to be working fine.
...

// pages/room.tsx
const ICE_SERVERS: RTCConfiguration = {
iceServers: [
{
urls: "stun:stun.l.google.com:19302",
},
// My TURN SERVER
{
urls: "turn:x.x.x.x:xxxx",
username: "username",
credential: "credential",
},
],
}

...
...

// pages/room.tsx
const ICE_SERVERS: RTCConfiguration = {
iceServers: [
{
urls: "stun:stun.l.google.com:19302",
},
// My TURN SERVER
{
urls: "turn:x.x.x.x:xxxx",
username: "username",
credential: "credential",
},
],
}

...
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server