How can I communicate over TCP sockets from JavaScript?

后端 未结 4 597
小鲜肉
小鲜肉 2020-12-01 03:58

I\'m thinking about how limiting it is for AJAX apps to have to poll for updates, when what would be ideal is for javascript to be able to set up a real two way connection t

相关标签:
4条回答
  • 2020-12-01 04:14

    Here is an implementation with a similar approach:

    • socketjs

    It uses a Java Applet and bridges its API to JavaScript, interesting...

    And here another one:

    • jSocket

    This one is a wrapper of the Actionscript 3 Socket API, bridged to JavaScript...

    0 讨论(0)
  • 2020-12-01 04:21

    jSocket and Stream are two options that utilize Flash's built-in XML sockets, though neither appears to be production-ready. I'd lean towards using a Flash-based solution rather than Java, as browser penetration is higher and generally offers a better user experience (load times & stability).

    0 讨论(0)
  • 2020-12-01 04:27

    WebSockets is designed to solve this problem.

    0 讨论(0)
  • 2020-12-01 04:29

    You can use node.js framework's socket.io package which can can be installed via npm (A node package manager).

    More detailed usage.

    0 讨论(0)
提交回复
热议问题