UDP/TCP Sockets Ionic; chrome.sockets alternative

I have been searching for a solution for UDP and TCP sockets for ionic.
normal websockets from mozilla can be used for TCP connections, but I see no way anywhere to implement UDP sockets.

In my case i need a socket to listen to a port on the local device, and send UDP dataframes to remote addresses/multicast addresses.

Previously I have used chrome.sockets but as the warning says the support will stop, so what alternatives are there ?
I’ve tried to get the normal Android sockets working for bot TCP and UDP but I can’t any example of these in use on ionic anywhere; so if I can use them how do i import them into my project?

Any help would be great as i am on the 3rd site in both duckduckgo and google and can’t find an alternative.


Pending how you want to deploy?


for Android/iOS I’d check UDP plugins for cordova and/or capacitor. I have played with UDP & cordova in distant past to discover devices. Worked for me.

On PWA/webonly, I’d check javascript solutions - javascript - How to talk to UDP sockets with HTML5? - Stack Overflow. I wouldn’t use the keyword Ionic in these types of searches. Javascript and UDP will do.

Next, there is a nice table showing alternatives for udp in chrome. Wouldn’t that work for you?

Thanks for the suggestings, I have already checked out that table!
I just want to develop of ios/android, but the table only shows alternatives for android, which i can’t use because i can’t see anywhere how to create sockets from the normal android developer layer.

then again if possible i would like to avoid having to write the identical code twice , once for android and once for apple.

And with the “i’d check UDP plugins for cordova and/or capacitor”, as far as i am aware i am not using capacitor, i am using cordova; but cannot for the life of me find a plugin that gives me a raw UDP socket.

the only one every post I’ve seen anywhere always mentions is the one from chrome.sockets.
the only one i actually did find was this: cordova-plugin-dgram - npm but it hasn’t been maintained in ages. and there is no explaination other than ripping appart the source code.

What i was mainly wondering is if there isn’t some thing coming to replace chrome.sockets it seems so widely used…

Same thing with this plugin and TCP cordova-plugin-chrome-apps-sockets-tcp - npm i am just not sure if its a good idea to use a package that was designed 5+ years ago

Worth the try as cordova and udp have been fairly stable in terms of specs. Maybe check cordova versions