关于WebSocket


#1

首先我说一下我的见解,要实现网页通信的话主要是三部分内容,第一个部分就是信令服务器实现客户端的连接,第二部分是相关网页的开发,第三个部分就是ICE框架实现NAT穿越,搭建STUN和TURN服务器,然后把这三部分连接起来就可以实现了,三个服务器+相关网页,那么问题来了,WebSocket是属于哪一部分呢??是第一部分还是第三部分,我从论文里面看似乎是属于第一部分,不知道大佬们能不能帮我解释一下


#2

属于第一部分,可以看下这篇文章,很好的解释了三者的关系。https://www.html5rocks.com/en/tutorials/webrtc/infrastructure/

其中,关于WebSocket部分,摘录如下:

WebSocket is a more natural solution, designed for full duplex client–server communication (messages can flow in both directions at the same time). One advantage of a signaling service built with pure WebSocket or Server-Sent Events (EventSource) is that the back-end for these APIs can be implemented on a variety of web frameworks common to most web hosting packages, for languages such as PHP, Python and Ruby.

About three quarters of browsers support WebSocket and, more importantly, all browsers that support WebRTC also support WebSocket, both on desktop and mobile. TLS should be used for all connections, to ensure messages cannot be intercepted unencrypted, and also to reduce problems with proxy traversal. (For more information about WebSocket and proxy traversal see the WebRTC chapter in Ilya Grigorik’s High Performance Browser Networking. Peter Lubber’s WebSocket Cheat Sheet has more information about WebSocket clients and


#3

所以相当于是Websocket是属于信令服务器那一部分的,谢谢了