开发者

Can be websockets used to create a client to client connection?

开发者 https://www.devze.com 2023-04-04 03:23 出处:网络
I want to make a client to client conection, using the server like a bridge momentarily, and I was seeing websockets but I don\'t know if that is posible. Any idea开发者_运维问答?There are plans for t

I want to make a client to client conection, using the server like a bridge momentarily, and I was seeing websockets but I don't know if that is posible. Any idea开发者_运维问答?


There are plans for this in the spec: http://www.w3.org/TR/2008/WD-html5-20080122/#peer-to-peer but I don't think any browsers support it yet.


You can't connect two clients using websockets without a server being the intermediary. The connection to the server would need to be alive throughout.


Besides the issue how two peers get to know each others IPs and setting aside any NAT-related issues making direct TCP connections between peers problematic, the WebSockets protocol itself is only asymmetric up to and including the initial WS handshake performed. After that, WS is fully symmetric.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号