Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What on earth is ReverseHTTP and why would it be useful?

reversehttp.net offers little immediate insight into what reversehttp truly is and how this can be best utilized, it makes it seem that this tool is too difficult to realistically implement. In what sorts of environments might this be the ideal real-time web data situation and when would this not work, What browsers support this method, and What is it exactly?

  • What makes reversehttp unique from other PUSH implementations?

Thank you to anyone who can help and has first of all heard of this, and knows what it is.

like image 554
Tom Avatar asked Jul 01 '10 03:07

Tom


3 Answers

Reverse HTTP is a way for the client to keep an open connection to a web server so that the web server can push updates to the client (rather than the client continually having to ask for updates).

Take your classic Twitter client for example.

Currently, the client asks Twitter periodically if you have any updates. If not, it's a wasted request.

With technology like Reverse HTTP, once you establish the connection to Twitter...Twitter would be able to send you the updates when they happen saving both you and Twitter some bandwidth, overhead, and a little effort.

Reverse HTTP works by running a Web Server inside the browser that the server communicates with.

There are similar technologies that accomplish the same goal in a safer, more secure way. Microsoft.NET implements these kinds of services as Duplex Binding services in WCF by keeping the connection between the client and server open once it is made (instead of running a seperate server on the client). There's also a technology called Comet which allows the same thing.

like image 136
Justin Niessner Avatar answered Sep 29 '22 04:09

Justin Niessner


I've looked at the source of the Reverse HTTP you linked to. The implementation consists of two parts:

  1. The HTTP relay. This one is hosted on the website reversehttp.net. It simply waits for requests to a certain URL (the one that is generated) and forwards it to a channel (see 2). It then waits on another channel (see 2), and forwards that to the requester.

  2. The HTTP JavaScript server. The "client server" polls the "server server" for any incoming requests using Ajax. Then, when you've requested the url on the "server server", and it's forwarded to a channel, it will be send to the "client server". The client server will then parse the original HTTP request from the request at step 1, create an answer (the HTTP reply). This answer will be send back to the "server server" which ends up in the channel which sends the actual reply back to the requester.

It's not at all hosting a real HTTP server on the client. This requires an open port 80, which most people don't have. If you're behind a NAT or a Firewall, it will be blocked any way, if configured well.

I guess using long-polling or Comet is a better idea than using this. The overhead of parsing HTTP headers on the client is quite cumbersome.

The specification describes a way of relaying HTTP requests. This will be done by setting the Content-Type header of any request to the "server server" to message/http. I think there are better solutions for proxying or relaying HTTP requests anyway, simply by changing the Host field of the to-be-relayed-to, adding a special field that contains some reference to the original sender and path it traversed, and sending the modified HTTP request to the next server. Then the receiver will send the request simply back, and the receiver looks for the special field, pops of it's origin, and passes the reply further in the chain.

like image 44
Pindatjuh Avatar answered Sep 29 '22 02:09

Pindatjuh


Just browsing the page: My reading is that instead of, say, a web browser polling for updates and pulling any new data, the web server instead pushes new data on the client when it becomes available.

For applications that require quick response to any new data, this would eliminate a lot of the traffic caused by repeated polling.

like image 32
Anon. Avatar answered Sep 29 '22 04:09

Anon.