How to establish a TCP Socket connection from a web browser (client side)?

前端 未结 5 1533
迷失自我
迷失自我 2020-12-01 00:11

I\'ve read about WebSockets but they don\'t seem to be pure \"sockets\", because there is an application layer protocol over them. \"ws:\"

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-01 00:50

    The benefit of WebSocket is that it is HTTP based. You can use it also in environments there http proxies are used. Thus Websocket has a higher infrastructure compatibility as plain tcp.

    Additionally http/WebSocket is providing you some features which you otherwise have to specify on your own:

    • Redirect
    • NAT keepalive
    • Multiplexing via URI
    • Framing

提交回复
热议问题