Leeft / xplane-websocket-proxy

ISC License
1 stars 3 forks source link

Just curious: why the server-client combination? #1

Open sanderdatema opened 3 years ago

sanderdatema commented 3 years ago

I just started working on making Stream Deck and X-Plane work together and stumbled upon your scripts. And I was wondering: what makes you choose to create this proxy? Can't you use your own X-Plane Node UDP Client in a Stream Deck plugin directly?

I'll gladly use your UDP client, if that's ok. Credits where credits due of course.

Leeft commented 3 years ago

Stream Deck code runs in a browser kind of environment (Chromium based I believe) rather than node.js, and that does not support UDP communication. So a proxy process to take care of that (or a plugin in X-Plane that can provides a websocket for JavaScript to talk to) is unfortunately necessary.

And yeah, if you can make use of my code you're welcome to it :)

Still working on the X-Plane plugin to provide a websocket to anything that needs it.

Leeft commented 3 years ago

I should add: it would be possible for e.g. a C++ plugin inside streamdeck to talk to X-Plane's legacy UDP protocol directly. But that means creating that stream deck plugin in C++, which wouldn't be my preference.

Mostly though the X-Plane Legacy UDP protocol has an annoying limitation in that it doesn't support begin/continue/end events (https://developer.x-plane.com/sdk/XPLMCommandPhase/) which also means some keys in e.g. the Zibo 737 won't work or won't work correctly when used through the Stream Deck. So you really need a kind of plugin on the X-Plane side to make "everything" possible.

sanderdatema commented 3 years ago

I didn't realize that. Previously I was working on an interface using en iPad and TouchOSC with Python. It also uses NASA's X-Plane plugin and that one does support the begin/continue/end events. But even with the limitations it'll be nice to get this to work. Even if it'll be simple (it will be, as I'm just a hobbyist and not a professional programmer 😀).

sanderdatema commented 3 years ago

Since it won't be possible to require modules I'll need to copy your client code into mine. Is that ok for you? I'll make sure to mention you at the top of the code, thanking you for the work you've done already. For now I'm working on it locally, but eventually I'd like to share it on Github.

Leeft commented 3 years ago

Sure, as per the license, knock yourself out :)