To learn how to make socket.io work with cPanel, check out the following post from cPanel. It explains the steps you need to follow to get it up and running.
I just tested it on a cPanel and CloudLinux server, and it worked perfectly, even with Node.js version 16.