Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for OBS Websocket 5.0 #335

Merged
merged 11 commits into from
Sep 29, 2022
Merged

Update for OBS Websocket 5.0 #335

merged 11 commits into from
Sep 29, 2022

Conversation

NikhilNarayana
Copy link
Member

@NikhilNarayana NikhilNarayana commented Sep 1, 2022

So the autoswitcher works with OBS 28+.

Still need to test with 2 PCs.

@NikhilNarayana NikhilNarayana requested review from vinceau and removed request for vinceau September 1, 2022 07:21
@NikhilNarayana NikhilNarayana marked this pull request as draft September 1, 2022 07:24
@NikhilNarayana NikhilNarayana marked this pull request as ready for review September 26, 2022 07:14
Copy link
Member

@vinceau vinceau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine for the most part but have a few nits.

@@ -1,62 +1,77 @@
import { EventEmitter } from "events";
import OBSWebSocket from "obs-websocket-js";
import { isIPv6 } from "net";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this function exists (as well as isIPv4) in the built in net package, how come we need to install the is-ip package?

if (chunks.length !== 4) {
return false;
}
import { isIPv4, isIPv6 } from "is-ip";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { isIPv4, isIPv6 } from "is-ip";
import { isIPv4, isIPv6 } from "net";

What's the difference from just importing these from the net package?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can't use net.isIP from renderer. I could add IPC but that seems overkill for this.

Copy link
Member

@vinceau vinceau Sep 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right. We could consider exposing it over the context bridge, similar to how to expose the the electron-log functions. E.g.

     // inside of preload.ts
     log: log.functions,
     net: { isIPv4, isIPv6 },

and then in the actual usage of it:

    const { isIPv4, isIPv6 } = window.electron.net; 

Although it does reduce a dependency, it also makes it harder to test logic and components since it now requires them to be injected over context bridge.

I'll defer it to you, but I'm happy to approve this change once the tests/build is passing.

Copy link
Member

@vinceau vinceau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once the build/tests are passing.

@NikhilNarayana NikhilNarayana merged commit df88a80 into main Sep 29, 2022
@vinceau vinceau deleted the deps/obs-websocket-5.0 branch February 7, 2023 13:02
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.

2 participants