mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-07 04:24:09 +09:00
fix(vesktop): avoid DTLS stalls with multiple interfaces (#66)
* fix(vesktop): add WebRTC IP handling support * fix(vesktop): constrain WebRTC interface selection
This commit is contained in:
@@ -1,7 +1,19 @@
|
|||||||
_: {
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
programs.vesktop = {
|
programs.vesktop = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
package =
|
||||||
|
if pkgs.stdenv.hostPlatform.isLinux then
|
||||||
|
pkgs.vesktop.overrideAttrs (old: {
|
||||||
|
patches = (old.patches or [ ]) ++ [ ./vesktop-webrtc-ip-handling-policy.patch ];
|
||||||
|
})
|
||||||
|
else
|
||||||
|
pkgs.vesktop;
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
discordBranch = "stable";
|
discordBranch = "stable";
|
||||||
|
|
||||||
@@ -16,6 +28,10 @@ _: {
|
|||||||
|
|
||||||
openLinksWithElectron = false;
|
openLinksWithElectron = false;
|
||||||
|
|
||||||
|
# Keep WebRTC on interfaces used by the default route. Vesktop's default
|
||||||
|
# policy may select secondary private interfaces and stall at DTLS.
|
||||||
|
webRTCIPHandlingPolicy = "default_public_and_private_interfaces";
|
||||||
|
|
||||||
spellCheckLanguages = [
|
spellCheckLanguages = [
|
||||||
"ja-JP"
|
"ja-JP"
|
||||||
"en-US"
|
"en-US"
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
diff --git a/src/main/index.ts b/src/main/index.ts
|
||||||
|
index 2f4c399a4..0c81512a4 100644
|
||||||
|
--- a/src/main/index.ts
|
||||||
|
+++ b/src/main/index.ts
|
||||||
|
@@ -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");
|
||||||
|
+ }
|
||||||
|
+});
|
||||||
|
diff --git a/src/shared/settings.d.ts b/src/shared/settings.d.ts
|
||||||
|
index 5b8fd6fff..b127f6def 100644
|
||||||
|
--- a/src/shared/settings.d.ts
|
||||||
|
+++ b/src/shared/settings.d.ts
|
||||||
|
@@ -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;
|
||||||
Reference in New Issue
Block a user