Closed djKianoosh closed 7 years ago
hi.. will look into this now.. does it work with the latest version (2.0.0-pre2.3)? Your version is a little old now..
npm install -g local-web-server@next
could you send me a simple test case please to help me reproduce?
still the same issue with 2.0.0-pre2.3
. I'll see if I can make something later tonight that you can use. My real backend is a Java service that implements SSE over servlets, but any service that implements the SSE spec should work. Basically something like a simple express.js server that pushes some data on an interval like one of these:
https://github.com/fmvilas/sse/blob/develop/examples/server.js (probably the simplest example) https://github.com/trquoccuong/Server-Sent-Events-Nodejs
Some other links I just dug (for the curious, and for reference later)... https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events https://github.com/schwarzkopfb/sse-broadcast http://bayn.es/real-time-web-apps-with-server-sent-events-pt-2/ https://technology.amis.nl/2017/02/19/node-js-application-using-sse-server-sent-events-to-push-updates-read-from-kafka-topic-to-simple-html-client-application/
thanks, looking into it now..
this is fixed in v2.0.0-pre2.4, please reinstall
npm install -g local-web-server@next
thanks again, let me know if you find anything else!
Fantastic. Works great... now -v
verbose output shows:
statusCode: 200,
statusMessage: 'OK',
url: '' },
data: [ SSE event-stream ] } }
👍
Does the new LWS support eventsource connections to backend services? The previous version was working fine. On version
eventsource
(aka Server Sent Events withaccept: 'text/event-stream',
) seem to always return empty responses. When using-v
to see the output, the data field is empty (see all the way at the end)...See the last line has empty data:
data: ''
. But when I hit my downstream service directly I get periodic events as expected. Is there a new middleware I need to configure/enable to turn on SSE for rewrite requests?I haven't tried websockets so it may or may not behave the same way.