Why don't browsers allow normal connection to be opened instead of Ajax or Comet?

If you want to open up a two-way connection between the browser and the server, your only choice is to poll (hammer the server) or use a comet (cool and prone to disconnection).

Why don't browsers allow normal TCP connection to be opened? Is there a practical benefit to not having this ability?

+1


a source to share


5 answers


The core HTTP protocol is basically a half duplex communication protocol, which is also stateless and does not support full duplex communication. However, with HTML 5 websites, that will change. Websockets is a new standard that is covered in the HTML 5 specification. After the specifications are complete and all browser vendors have adopted the standards, you can use the web ports to establish a dedicated TCP connection across the browsers.

We must also remember that HTTP was primarily intended for the delivery of documents and the exchange of information between geographically dispersed teams, and was not intended as a communication protocol per se.



Having said that, there are already companies that have created multiple messaging gateways so that you can implement full duplex communication.

+5


a source


Given that this functionality is effectively accessible via flash, there is no real rationale for security, but no browser these days wants to be the first to implement a custom extension like this. Moreover, there is no easy way to do streams, which can make using a socket rather awkward.



0


a source


Over the years, many aspects or elements of the Internet have been captured to provide a richer experience. Comet is just one example where long lived connections have been used to allow server-side push. Originally, web pages were only meant to be hyperlinked with text, not the rich apps we often see today. The hacks and abuse of what the original thought suggested will continue until one day these things become more standardized.

0


a source


The answer to your question is essentially no, there is no tangible benefit to not opening a two-way connection between client and server in the browser. The reason this cannot be done is because it was not the goal of web browsers that were designed to poll / retrieve documents. With the advent of Rich Internet Applications, it has become desirable to have this functionality, but this has never been the goal of a browser before. There is currently a void that needs to be filled with a possible protocol or an implementation of an existing protocol that will regulate two-way communication between the browser and the server. There are existing techniques used to model this behavior to varying degrees (AJAX, Comet, etc.), or it can be done with built-in objects (Java, Flash, ActiveX Controls in IE).but these are just paths around the void, not bridges it.

We'll just have to wait (or act) for a standard to be written and subsequent implementation. Chances are, the implementation actually comes first and we'll have a bunch of new cross-browser compatibility issues to enjoy :) Oh bleeding edge!

0


a source


firewalls. Non-HTTP traffic is often blocked by firewalls, so a random TCP port is often rejected for communication.

0


a source







All Articles