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");
}
});
@@ -9,6 +9,7 @@ import "./settings.css";
import { classNameFactory } from "@vencord/types/api/Styles";
import { BaseText, Divider, ErrorBoundary } from "@vencord/types/components";
import { ComponentType } from "react";
import { WebRTCIPHandlingPolicyPicker } from "renderer/components/settings/WebRTCIPHandlingPolicyPicker";
import { Settings, useSettings } from "renderer/settings";
import { isMac, isWindows } from "renderer/utils";
@@ -146,8 +147,11 @@ const SettingsOptions: Record<string, Array<BooleanSetting | SettingsComponent>>
title: "Open Links in app (experimental)",
description: "Opens links in a new Vesktop window instead of your web browser",
defaultValue: false
}
},
WebRTCIPHandlingPolicyPicker
],
"Developer Options": [DeveloperOptionsButton]
};
@@ -0,0 +1,42 @@
/*
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { Heading, Margins, Paragraph } from "@vencord/types/components";
import { Select } from "@vencord/types/webpack/common";
import { SimpleErrorBoundary } from "../SimpleErrorBoundary";
import { SettingsComponent } from "./Settings";
export const WebRTCIPHandlingPolicyPicker: SettingsComponent = ({ settings }) => {
return (
<SimpleErrorBoundary>
<div>
<Heading tag="h5">WebRTC IP Handling Policy</Heading>
<Paragraph className={Margins.bottom8}>
Changing this may help with voice connection issues on some networks, most notably VPNs like
Tailscale.
</Paragraph>
<Select
placeholder="Default"
options={[
{ label: "Default", value: "default", default: true },
{ label: "Default Public Interface Only", value: "default_public_interface_only" },
{
label: "Default Public And Private Interfaces",
value: "default_public_and_private_interfaces"
},
{ label: "Disable Non-Proxied UDP", value: "disable_non_proxied_udp" }
]}
closeOnSelect={true}
select={v => (settings.webRTCIPHandlingPolicy = v)}
isSelected={v => v === (settings.webRTCIPHandlingPolicy ?? "default")}
serialize={s => s}
/>
</div>
</SimpleErrorBoundary>
);
};
+5
View File
@@ -9,6 +9,11 @@ import type { Rectangle } from "electron";
export interface Settings {
discordBranch?: "stable" | "canary" | "ptb";
transparencyOption?: "none" | "mica" | "tabbed" | "acrylic";
webRTCIPHandlingPolicy?:
| "default"
| "default_public_interface_only"
| "default_public_and_private_interfaces"
| "disable_non_proxied_udp";
tray?: boolean;
minimizeToTray?: boolean;
autoStartMinimized?: boolean;