Its not going to work I'm afraid. HTML has pretty strict security policies around socket connections between peers. You need a server-client infrastructure thats written to take advantage of websockets (which are not the same as regular sockets, they have a bunch of headers and other features). You CANT talk across browsers, and thats by design to stop malicious web pages scanning and breaking into your network via the browser.
Look at it this way. The majority of people never change the passwords on their router. If a browser allowed unhindered TCP socket access, a hacker simply has to write a webpage that does a quick TCP-Traceroute to find the first hop and thus the router, hit the router with a small database of known admin passwords for popular routers, then it can get in , and open up the network for more powerful hacking tools to enter your network and start pwning all your machines, take over your cameras, unlock your smartdoor, siphon your bank cards, and any number of other nefarious deeds. Its an insanely bad idea.