comparison src/goodjava/webserver/ServerSentEvents.java @ 1742:d778f1f2598a

make server side events proxy work
author Vadim Filimonov <fffilimonov@yandex.ru>
date Tue, 08 Nov 2022 09:32:46 +0200
parents 623d9f62ab92
children
comparison
equal deleted inserted replaced
1741:623d9f62ab92 1742:d778f1f2598a
72 Writer writer = con.writer; 72 Writer writer = con.writer;
73 writer.write("HTTP/1.1 200 OK\r\n"); 73 writer.write("HTTP/1.1 200 OK\r\n");
74 writer.write("Access-Control-Allow-Origin: *\r\n"); 74 writer.write("Access-Control-Allow-Origin: *\r\n");
75 writer.write("Cache-Control: no-cache\r\n"); 75 writer.write("Cache-Control: no-cache\r\n");
76 writer.write("Content-Type: text/event-stream\r\n"); 76 writer.write("Content-Type: text/event-stream\r\n");
77 writer.write("X-Accel-Buffering: no\r\n");
77 writer.write("\r\n"); 78 writer.write("\r\n");
78 writer.flush(); 79 writer.flush();
79 80
80 String url = request.url(); 81 String url = request.url();
81 EventHandler handler; 82 EventHandler handler;