How to get stream result on client? #2765
Unanswered
chengfengfengwang
asked this question in
Q&A
Replies: 2 comments 1 reply
-
This issue has been bothering me for a day. I found that when I develop locally using Wrangler, the messages do not flow. However, when deployed to Cloudflare Worker, the code behaves as I expected! I don't know if this is a Wrangler issue or a Hono issue. |
Beta Was this translation helpful? Give feedback.
1 reply
-
https://hono.dev/docs/helpers/streaming#streamtext If you are developing an application for Cloudflare Workers, a streaming may not work well on Wrangler. If so, add Identity for Content-Encoding header. app.get('/streamText', (c) => {
c.header('Content-Encoding', 'Identity')
return streamText(c, async (stream) => {
// ...
})
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I expected this code to send two messages: the first one being 'Hello', and the second one 'Hono!' after 3 seconds. However, I only received one message after 3 seconds. I am new to Hono. Can you help me?
Beta Was this translation helpful? Give feedback.
All reactions