I'm just now getting started with websockets and am very confused already. I thought socket.io was a convenience around using sockets- but after trying to get socket.io client to connect to BrainSocket (laravel websocket plugin; port 8080 whereas laravel serves port 8000), socket.io keeps yelling at me about cross origin restrictions. It's odd, because vanilla websockets work just fine.
I'm hesitant to use vanilla because if the client doesn't have sockets, my app will simply break instead of falling back to other shims that I hear socket.io client-side provides.
I can't find many examples about socket.io and of the ones I do find, they're always plugging into a node implementation of socket.io server-side. That leads me to believe what I'm trying to do is actually impossible and socket.io client-side is strictly intended to be used only in node applications?
$(function(){
// This code works!
var socket = new WebSocket("ws://localhost:8080");
// This code doesn't work and yells "cross origin! Not allowed!"
var socket = io("ws://localhost:8080");
});