I am trying to get a stream of data displaying on my console, but I'm probably not aware of the right tools. If I try to get the data from curl it works fine and looks like this:
C:\Users\user>curl localhost:8080/slow/5
5
4
3
2
1
0
C:\Users\user>
First I tried to use a standard http get request,
constructor(
private http: HttpClient,
private ngzone: NgZone
) {
this.http.get('/slow/5').subscribe(x => console.log(x))
}
and this is the error I get after 5 secs:
error: Object { error: SyntaxError, text: "5\n4\n3\n2\n1\n0\n" }
I tried to use the EventSource method, but that doesn't even manage to connect it. Proxies work fine. Any ideas?