Executing built-in HTTP server with comets

I love Grizzly's idea, but I can't find any good examples to work with. Well, any good tutorial ... I want to have a built-in HTTP server that I can talk to with Dojo. I don't need a J2EE server and I want to use Java. What do you think?

+2


source to share


3 answers


Java6 has a simple built-in http server.



http://java.sun.com/javase/6/docs/jre/api/net/httpserver/spec/index.html

+2


source


StreamHub Push Server is a comet server written in Java. you can use it like a JAR to push it onto your stack. It also acts as a simple HTTP server. It is not integrated with dojo.io, but there are many good examples using a simple javascript library.

var hub = new StreamHub();
hub.connect("http://localhost:7979/");
hub.subscribe("MyTopic", function(topic, json) {
    alert("got update on topic: " + topic + " MyField=" + json['MyField']);
});
// ...

      



Oh, and for a good tutorial, try Getting Started with StreamHub and Comets .

+3


source


Jetty supports asynchronous servlet continuations and comet-style programming. See the documentation index . It can also be easily run in another Java application.

+2


source







All Articles