Created by: morrislaptop
In my scenario, the page is being served by PHP and the URL to the bundle is pointed directly to the webpack dev server.
So, the website is being served at http://my-project.test and the script is pointing to http://localhost:8080/app.js.
By using window.location for the webpack dev server client, it is forcing the sockjs server to be on the same domain as the page. However, it's more accurate to get the dev server from the script.
Reference: