I’ve made a little progress, but the fix is somewhat complex and might take us a little bit unfortunately. If you add the following code at the top of your handler function you will get a little further;
if (req.url === "/socket.io/socket.io.js" ||
req.url === "/socket.io/socket.io.js.map")
return io.serve(req, res);
This will make it so the socket.io script is at least loaded in the page, but I can’t get the connection event to fire yet (I see requests going back and forth though). Either way, perhaps this helps you get a little farther, and we’ll try a few more workarounds too to see if we can get you using this sooner than when our real fix is implemented.
So, just to conclude: this is definitely our bug, I have a vague idea of how to fix it, but it will take a little time so hopefully we can find a workaround in the meantime to get you going (or perhaps give you enough info to help you find a workaround). Really sorry for this, we definitely want to fix it!