How can I receive UDP messages or similar in WebGL?

Hi. I have a java app that sends UDP messages, and I need to build a Unity WebGL app that receive those messages and do stuff. I read that WebGL doesn’t support UDP communication because of security reasons. Okay, I thought on 2 possibilities: 1- Build another java app that sends TCP messages and try to receive them on unity. 2- Build another java app that communicates with unity using WebSockets.

I tried both of them, but didn’t get it. I’m a bit lost. Is what I want even possible?

someone knows something?