Difference between socket and websocket?

前端 未结 5 980
逝去的感伤
逝去的感伤 2020-11-28 17:36

I\'m building web app that needs to communicate with another application using socket connections. This is new territory for me, so want to be sure that sockets are differen

5条回答
  •  囚心锁ツ
    2020-11-28 18:09

    To answer your questions.

    1. Even though they achieve (in general) similar things, yes, they are really different. WebSockets typically run from browsers connecting to Application Server over a protocol similar to HTTP that runs over TCP/IP. So they are primarily for Web Applications that require a permanent connection to its server. On the other hand, plain sockets are more powerful and generic. They run over TCP/IP but they are not restricted to browsers or HTTP protocol. They could be used to implement any kind of communication.
    2. No. There is no reason.

提交回复
热议问题