adzialocha / osc-js

OSC library for Node.js, Electron, Chrome Apps, Webpages or any other JS application. It comes with a customizable Plugin API for WebSocket, UDP or bridge networking
https://adzialocha.github.io/osc-js
MIT License
258 stars 30 forks source link

Can we avoid using websocket and use the library in the browser? #68

Closed JSmithOner closed 7 months ago

JSmithOner commented 1 year ago

Is this possible to use this library without socket? More generally is it possible to use OSC without websocket directly from browser? I'm not sure to understand what the websocket is here for but I guess there is an explanation. wouldn't be possible to do something like

osc.open( { host:'127.0.0.1', port:8080 } );

and send some OSC message to this port directly over UDP for example. I'm quite a newbie to OSC so I'm trying to understand

Thanks in advance

adzialocha commented 1 year ago

Hi @JSmithOner,

That's a good question! Sadly there's currently no support for UDP requests from the browser, our options are basically limited to WebSocket or WebRTC. Soon there's surely support for WebTransport (that's QUIC, which is UDP-based) and I know about efforts to even introduce UDP one day: https://github.com/Maksims/web-udp-public but that might still be many years

JSmithOner commented 1 year ago

@adzialocha Thank you for your answer, I just looked at WebTransport sounds promising but I don't as WebRTC doesn't it implies the receiver and sender to have the communcation protocol built-in?Thanks in advance. Btw I also looked at webassembly but looks like it the same problem.