Some testers told me that the Avast shieldWeb still blocks the comet request.
So it appears that the prefix "DWR-Reverse-Ajax" for the Server's name in the header is necessary but not sufficient...
(more info about this solution)
Right now Avast doesn't white-list the request just with the part on the header...
So what's the solution ?

Ok this hack seems very strange, but at least it works.
Basicly, Avast looks afraid when you just send him the header first, and nothing else.
So if you want to be nice with him, start by sending him a nice "\r\n" (= Server.EOL for End Of Line in the exemple) ! (I assume that he will interpret that as a first chunk, but i'm not sure...)
Ok it seems better : we have the connexion stucked just a 50% !
So what's wrong now ? Can't really tell you, but it seems that if you send the 2 EOL of the end of the header and in the same time the EOL for the first chunk, it's too much for avast. So you need to first send him the header with the 2 EOL. Wait a couple of milisec, and nex send him a first EOL chunk.
After that you can push as usualy :)

So Here is the very very strange but 100% solution :

  1. public void send () {
  2. Calendar c = Calendar.getInstance();
  3. String date = c.get(Calendar.DAY_OF_MONTH) + "/" + c.get(Calendar.MONTH) + "/" + c.get(Calendar.YEAR);
  4. try {
  5. this.pw.print("HTTP/1.1 200 OK");
  6. this.pw.write(Server.EOL);
  7. this.pw.print("Date: "+date);
  8. this.pw.write(Server.EOL);
  9. this.pw.print("Server: DWR-Reverse-Ajax Comet AvriChatServer");
  10. this.pw.write(Server.EOL);
  11. this.pw.print("Cache-Control: no-store, no-cache");
  12. this.pw.write(Server.EOL);
  13. this.pw.print("Connection: Connection");
  14. this.pw.write(Server.EOL);
  15. this.pw.write(Server.EOL);
  16. try {
  17. Thread.sleep(50); //in my case, I have wrong connexion under 50/100ms
  18. } catch (InterruptedException e) {
  19. e.printStackTrace();
  20. }
  21. this.pw.write(Server.EOL);
  22. } catch (IOException e) {
  23. e.printStackTrace();
  24. }
  25. this.pw.flush();
  26. }

Does that means that we have to had 50/100ms to every clients, with or without avast web shield ?
One solution could be to first start a normal connexion. If we dont have any answer after 500ms for exemple, we close the connexion, and start a new one in which one the server will have to wait a couple of milisec during the two EOL...

If you have any suggestion or better explanations...