Skip to content
chinaccj edited this page Oct 24, 2016 · 2 revisions

Welcome to the SSEServer wiki!
Server-Sent Events/sse servlet

介绍: 使用servlet3.0 实现的sse 简单服务。麻雀虽小,五脏具全。

背景 最早的时候使用spring的SseEmitter实现,,但是当服务端超时的时候,chrome 会抱net::ERR_INCOMPLETE_CHUNKED_ENCODING 索性,只能用servlet3 实现了个。

使用 客户端连接建立 http://localhost:8080/events/subscribe.do

向某个客户端推送消息 http://localhost:8080/push?sid=B9B78EBFCDED7A93334DB7FAE8E58F48&message=fff

其中sid为新建连接的sessionid,可以从console 日志抓取

支持用户打开多个页签,push同一个用户的多个页签

Clone this wiki locally