Skip to content

✨ Quality: Default PeerJS host to self-hosted server instead of 0.peerjs.com#351

Open
chinhkrb113 wants to merge 2 commits into
kern:mainfrom
chinhkrb113:contribai/improve/quality/default-peerjs-host-to-self-hosted-serve
Open

✨ Quality: Default PeerJS host to self-hosted server instead of 0.peerjs.com#351
chinhkrb113 wants to merge 2 commits into
kern:mainfrom
chinhkrb113:contribai/improve/quality/default-peerjs-host-to-self-hosted-serve

Conversation

@chinhkrb113
Copy link
Copy Markdown

Problem

The current default for PEERJS_HOST is '0.peerjs.com', an external service. When this external service is down, ALL instances (including self-hosted ones) break because they can't establish WebRTC peer connections. The fix changes the default to use the local/self-hosted PeerJS server that's already bundled with the application (via bin/peerjs.js). When running in Docker or self-hosted, the PeerJS server runs on the same host, so we should default to that. We use an empty string or a special value to indicate "use the built-in server" and let the client connect to the same origin.

Severity: critical
File: peerjsPath,

Solution

Change the default PEERJS_HOST from '0.peerjs.com' to '' (empty string, meaning same host/origin) and PEERJS_PATH to '/peerjs'. This way, when no env vars are set, the app uses its own bundled PeerJS server. The client-side code will connect to the same host the app is running on. Update the defaults:

Changes

  • src/app/api/ice/route.ts (modified)
  • README.md (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

Closes #341

….peerjs.com

The current default for PEERJS_HOST is '0.peerjs.com', an external service. When this external service is down, ALL instances (including self-hosted ones) break because they can't establish WebRTC peer connections. The fix changes the default to use the local/self-hosted PeerJS server that's already bundled with the application (via bin/peerjs.js). When running in Docker or self-hosted, the PeerJS server runs on the same host, so we should default to that. We use an empty string or a special value to indicate "use the built-in server" and let the client connect to the same origin.

Affected files: route.ts, README.md

Signed-off-by: ChinhLee <76194645+chinhkrb113@users.noreply.github.com>
….peerjs.com

The current default for PEERJS_HOST is '0.peerjs.com', an external service. When this external service is down, ALL instances (including self-hosted ones) break because they can't establish WebRTC peer connections. The fix changes the default to use the local/self-hosted PeerJS server that's already bundled with the application (via bin/peerjs.js). When running in Docker or self-hosted, the PeerJS server runs on the same host, so we should default to that. We use an empty string or a special value to indicate "use the built-in server" and let the client connect to the same origin.

Affected files: route.ts, README.md

Signed-off-by: ChinhLee <76194645+chinhkrb113@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Website down

1 participant