0

how can we do server side push?

4 Answers4

3

There are multiple ways to do server side push, main technologies are Long Poll and Web Streaming. However, with advent of HTML5, web socket is a good option. Beware: Not all browsers are HTML5 ready.

Read more on web-socket here

For Comet or Long Polling you can see discussion here: Best solution for Java HTTP push (messaging)

Community
  • 1
  • 1
Nishant
  • 54,584
  • 13
  • 112
  • 127
1

long polling.. here is the article about server push with gwt http://code.google.com/p/google-web-toolkit-incubator/wiki/ServerPushFAQ . Bu the concepts are valid for other client side technologies..

Gursel Koca
  • 20,940
  • 2
  • 24
  • 34
1

Is it true that you are in a HTTP environment as GUrsel and UNNI assume?

In this case they point in the right direction. "Long Polling" or keywords like "Comet" and "Bayeux" should give you a good start to select a HTTP based protocol.

WebSocket seem to get the upcoming standard in the upcoming world of HTML5. As this is a quite interesting technology, many implementations exist already BUT are not yet standard!! You should also consider that major browsers have stopped Websocket support recently because of security issues.

In any non HTTP protocol environment, please clarify your question.

mtraut
  • 4,720
  • 3
  • 24
  • 33
  • can you please highlight any of the security issues? – UVM Dec 30 '10 at 13:31
  • well, even the client server communication is not http, for example rmi, long polling is still a valid option. Alternative to long polling is JMS for such an environment. – Gursel Koca Dec 30 '10 at 13:32
  • i'm not personally involved in security reviews, but maybe you find information here http://hacks.mozilla.org/2010/12/websockets-disabled-in-firefox-4/ and related links to "websocket security". I'm sorry – mtraut Dec 30 '10 at 14:07
  • Ok, to be more abstract: Long polling does make sense when you have a strict Request-Reply communication pattern as in HTTP. Why should i feed such a beast in RMI? This would mean i call a method only to wait a (very) long time for the reply, which contains a call to some of my services. – mtraut Dec 30 '10 at 14:15
  • 1
    this is my understanding abt web socket: 1.currently all the server side push technologies works based on HTTP. 2.web Socket works on TCP layer. 3.So the current security vulnerabilities that are existing in HTTP layer would be less in websocket. 4.security vulnerabilites invloved in websocket is based on the environemnt in which the request is being routed by proxy to original host.Because does not aware of websockets – UVM Jan 04 '11 at 05:41
0

If anyone is interested in a Java implementation I just wrote a sample app and a blog post about it. It uses Java, Maven, Comet, Bayeux, Spring. http://jaye.felipera.cloudbees.net/ http://geeks.aretotally.in/thinking-in-reverse-not-taking-orders-from-yo

Felipe Oliveira
  • 1,041
  • 9
  • 9