Add setting for WebRTCIPHandlingPolicy (#1283)

Co-authored-by: Zylanx <32674125+Zylanx@users.noreply.github.com>
This commit is contained in:
2meito
2026-07-21 01:06:29 +00:00
committed by GitHub
co-authored by Zylanx
parent 8a718e0078
commit f054ca2f03
4 changed files with 64 additions and 1 deletions
+12
View File
@@ -158,3 +158,15 @@ app.on("open-url", (_, url) => {
app.on("window-all-closed", () => {
if (process.platform !== "darwin") app.quit();
});
// Sets the WebRTC IP handling policy for all current and future windows.
// Switching to "default_public_and_private_interfaces" may fix calls stuck at "DTLS Connecting" when using VPNs, Tailscale, etc.
// https://github.com/Vencord/Vesktop/issues/876
app.on("web-contents-created", (_event, contents) => {
contents.setWebRTCIPHandlingPolicy(Settings.store.webRTCIPHandlingPolicy ?? "default");
});
Settings.addChangeListener("webRTCIPHandlingPolicy", () => {
for (const win of BrowserWindow.getAllWindows()) {
win.webContents.setWebRTCIPHandlingPolicy(Settings.store.webRTCIPHandlingPolicy ?? "default");
}
});