The code below sends "ping" to my localhost server in java, how would I do the same thing in JavaScript?
new PrintWriter(new Socket("127.0.0.1", 9002).getOutputStream(), true).println("ping");
I ran it in javaScript and it said:
Uncaught ReferenceError: PrintWriter is not defined