ngx-sse-client
ngx-sse-client copied to clipboard
Could not work in nginx env?
Thank you for providing such an excellent project. Recently, I used it in an access project. During development, I used angular dev server to configure proxy to nginx, and then nginx proxy to the application. The entire link met expectations, but after compilation and deployment to nginx, it did not meet expectations. The stream() method will only enter into the application message after completion.This makes the request much like a regular ajax, with the request ending before entering the method
this.chatSubscription = this.sseClient
.stream(
`/v1/chat-messages`,
{
keepAlive: true,
reconnectionDelay: 1_000,
responseType: "event",
},
{
body: {
moduleId: this.moduleId,
query: question,
conversationId: this.lastConversationId,
},
},
"POST"
)
.pipe(
finalize(() => {
this.isAsking$.next(false);
})
)
.subscribe()
In addition, I found that I only entered the parseStreamEvent() method after receiving all responses