Is there a Telnet library for JavaScript?

后端 未结 4 883
难免孤独
难免孤独 2020-12-16 12:38

We have a network camera. It has an HTTP server to provides the current image. There is also a Telnet interface for controlling the camera (i.e. trigger, focus, etc.). I

4条回答
  •  难免孤独
    2020-12-16 12:51

    Thomaschaaf is correct, while HTML5 introduces websockets you'll find they still require special server support as they post HTTP style information upon opening the socket:

    JS/HTML5 WebSocket: Connect without HTTP call

    The best way, currently, to have true sockets is to either

    • use a flash or Java component on the webpage that does the actual socket work.
    • use a proxy server with websockets that can handle the additional protocol overhead of websockets and connect to the real tcp/ip port with plain sockets.

    The jsterm example Matt linked does the latter, and if your webcans are behind a firewall it will not work in your situation without also implementing another server.

    There are libraries that implement the first method, two are linked here for convenience, many others can be found using a search engine:

    http://stephengware.com/proj/javasocketbridge/ (Java)

    http://matthaynes.net/blog/2008/07/17/socketbridge-flash-javascript-socket-bridge/ (Flash)

提交回复
热议问题