简体   繁体   中英

Check telnet connection with server IP and Port number in JScript

I need to test telnet connection to the server in my local pc. My pc don't have any server side languages like PHP, NodeJS,.. I want to do this in basic JavaScript or chrome extension from latest chrome. I have checked with websocket HTML5. But, it was not working. Here's my code,

<script>
 var connection = new WebSocket('ws://10.0.30.1:80');

 connection.onopen = function () {
  connection.send('Ping'); // Send the message 'Ping' to the server
 };

</script>

Lets explain what's my mistake and give me a solution if any other possible.

You can't. Unless you set up a proxy server, a websocket can only communicate with a websocket server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM