this is not a question but a great help difficult to find on the internet,
to correctly configure socket.io with apache2 through websocket requests and not polling requests, here is how to proceed:
First :
create your socket.io server like const io = require('socket.io')(yourPort)
Second : add in your favorite vHost these parameters
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/socket.io [NC]
RewriteCond %{QUERY_STRING} transport=websocket [NC]
RewriteRule /(.*) ws://localhost:yourPort/$1 [P,L]
ProxyPass /socket.io http://localhost:yourPort/socket.io
ProxyPassReverse /socket.io http://localhost:yourPort/socket.io
(modify yourPort by the correct port where your server listen)
Third : Create your HTML page with
let socket = io.connect('yourWebsite', { transports: ['websocket'] });
Now if you want you can add this in your server for check if it's work
io.on("connection", socket => {
console.log("it's work !")
})
100% working do not thank me :) Have a nice day.