java - Xmpp Vs Websocket -
java - Xmpp Vs Websocket -
i'm develop website has near real time chat. know can implemented using xmpp or websocket protocols. know xmpp protocol has been developed in 1999 , , guess should mature nowadays .on other hand , websocket protocol has been developed in 2011.
what need websocket if xmpp in handling real time conversations? what major differences between 2 protocols? and when should take 1 of them on other?
the short reply 'both'.
xmpp set of application protocol doing real-time chat (and many other things, matter) - has transported across network somehow, need transport binding. there 3 main transport bindings xmpp -
tcp/ip, 1 uses on net native clients on devices http (called bosh), 1 has traditionally used when using xmpp in browser (as tcp-ip isn't available javascript apps in browser) websockets, 1 1 uses when doing xmpp in modern browser.so if you're developing chat application in browser, you'd take xmpp application protocol , you'd utilize websockets (in modern browser) or bosh (in older browser) network transport. if utilize xmpp library javascript stanza.io (https://github.com/otalk/stanza.io), it'll back upwards both , you'll thinking 'xmpp' rather transport layer, other @ setup when have tell endpoint connect to.
(you can't utilize 'just websockets' chat - can utilize websockets without xmpp, means you're inventing own application-layer protocol chat, , odds you're going save lot of time , headaches taking advantage of work that's gone writing 1 useful properties (security, identity, extensibility etc.) , there existing libraries , servers going xmpp instead.)
java websocket xmpp real-time near-real-time
Comments
Post a Comment