At this time EventSub only offers a Webhook Transport
EventSub over sockets is in Closed Beta testing, and basically replaces PubSub.
However there is no timeline on general availability.
You are doing yourself a disservice by limiting yourserlve to SE Custom Coded Widgets. This forum is unlikely to know what SE can or cannot do, since most of use will not limit ourself to the limitations of SE.
As it stands to consume HypeTrain data “sanely” you need a middle man server to consume the EventSub information.