Comet and ajax with Avast's shield web : The salvation - or not
Par Quentin Ambard le mercredi, mai 20 2009, 15:39 - Comet & Ajax - Lien permanent
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 :
public void send () { Calendar c = Calendar.getInstance(); String date = c.get(Calendar.DAY_OF_MONTH) + "/" + c.get(Calendar.MONTH) + "/" + c.get(Calendar.YEAR); try { this.pw.print("HTTP/1.1 200 OK"); this.pw.write(Server.EOL); this.pw.print("Date: "+date); this.pw.write(Server.EOL); this.pw.print("Server: DWR-Reverse-Ajax Comet AvriChatServer"); this.pw.write(Server.EOL); this.pw.print("Cache-Control: no-store, no-cache"); this.pw.write(Server.EOL); this.pw.print("Connection: Connection"); this.pw.write(Server.EOL); this.pw.write(Server.EOL); try { Thread.sleep(50); //in my case, I have wrong connexion under 50/100ms } catch (InterruptedException e) { e.printStackTrace(); } this.pw.write(Server.EOL); } catch (IOException e) { e.printStackTrace(); } this.pw.flush(); }
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...
Commentaires
Well worded. My thanks for posting this. I will definitely check here to see what's new and tell my people about you.
Awesome. My thanks for doing such a good job. I'll definitely come here to see what's new and recommend my people about your website.
Well worded. Thanks for writing that. I will come to your site to see what's new and tell my friends about your site.
Good reading. My thanks for taking the time. I'll come to this site to see what's new and inform my acquaintenances about your posting.
Loved it. My thanks for doing such a good job. I will definitely return here to find out more and tell my neighbors about your writing.
Marvelous accuracy with this particular internet site. Anyway i was pleased with reading it again, and therefore will most certainly revisit repeatedly, on the search for something new.
Amazing presentation through this web site. My wife and i learned from surfing around it all, and thus definitely will keep coming back constantly, searching for something different.