'Socket.io slow on local network

I'm trying to test a socket.io page, so I have a webserver (XAMPP) running on my machine. I know why you shouldn't use your own computer to host websites, and this website will never go public anyways. It's just a test page.

To configure socket.io to work with devices outside my home network, I use the line io('http://my-public-ip:3001');, instead of what I was using for testing, io('http://localhost:3001');. This works great for devices outside my network (I tested it, and it works well), but not so much for the ones on it. For example, trying to go to the page from my computer via its own public IP or localhost just results in a slow connection at best that doesn't usually work.

Any help is much appreciated!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source