You can not do this with PHP, JavaScript or WebSockets. If you will open a connection between two clients, clients' system must allow a port to open at least. Which can not be done any of these. It requires an access to OS. If you could do this from browser, it would be a security issue.
You may can do this with a Java applet if it had to be done through browser. Which accesses to underlying JVM which can access to OS functions with proper permissions.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…