`wrangler tail` with WebSockets

Is this not true for any incoming Websocket requests? - I have a console log inside of the websocket.addEventListener("message" in the websocket template on Cloudflares Github pages and I've noticed that it doesn't log those live, only when you close the connection do all the logs show up
B
Bonsaye19d ago
@Isaac McFadyen | YYZ01 sorry for the ping but I figure I ask you as you and I were chatting about this in the workers-discussions channel. But if anyone else knows what I can do to make those logs show up, please let me know
IM
Isaac McFadyen19d ago
Hi! Yeah no worries. So it should show those logs? Interesting that it's not. Close the connection - you mean you tail, and then hit Control C (or End on the dashboard) and they suddenly show up?
B
Bonsaye19d ago
yeah, that's what I mean see if I can get a gif going one second
B
Bonsaye19d ago
No description
B
Bonsaye19d ago
I am using this template, https://github.com/cloudflare/websocket-template, however, I have taken all of the template.js content and put it inside of a index.html and used live-server to run the index.html (sharing this incase it matters) just re-reading this, i said yes earlier but, it's not exactly what I was doing. If I close the connection like I've shown in the gif or if I change the url to another site or refresh the connection ( all those actions terminate the websocket connection )
D
DaniFoldi19d ago
this is expected, websocket traces (tails) are only delivered when the connection is closed if you have long-lived connections that you want to monitor, you can either use an external service (like Axiom, Datadog, etc etc), or you can do a hack which is basically you make a request to another zone (so not with a service binding, just fetch()) and "send" your log to that worker and if you tail that auxiliary worker, you should see the logs appear quicker
B
Bonsaye18d ago
ok, thank you both.
Want results from more Discord servers?
Add your server
More Posts
env variables are empty - HonoHello can you help me with some small example how to work locally with env variables? I tried c.env.I will check that out. Thank you! Do youI will check that out. Thank you! Do you mind me asking what tech stack you use? Do you try to use a522 ErrorHi all, I tried updating the CNAME from '@' to 'www.' so I can so more dynamic stuff with multi-repwrangler preview output is not the same as liveHello all, finally I got my astro project buildable. Using `wrangler pages dev ./dist` my website lWhat headers come back?I have one question. If I use Azure and I move to ai gateway will I still be able to receive the heaMultiple Set-Cookie headers folded into one headerIn the documentation (https://developers.cloudflare.com/workers/runtime-apis/headers/), it says thatCloudflare Tunnel routing through wrong locationsI have a tunnel that I use as an alternative to opening ports on my local network, however, there isRegister DomainHi. I cant pay for new .com domain. I can't figure out what could be the problem. The bank side saysCloudflare icons and stencils for diagramming.Do we have an open source repository with Cloudflare-specific icons?"Pro" plan, but can't see the Caching page.Hi there, I've subscribed to the "Pro" plan, but it seems I don't have access to the "Caching - Ovecan you provide an url for mp3?can you provide an url for mp3?Downloading data before building pages (SSG/SSR)I have the use case that I'm experimenting building a Cloudflare Pages project using Astro. It willJust the domain is neededJust the domain is neededRequest failed with status code 408 (Request Timeout)Failed upload sourcemap for [dist/assets/SecondaryButton-e.js.map]: Request failed with status code opened a PR to allow native web_sysopened a PR to allow native web_sys request, without having to ditch the event macro: https://githubVPN tunnel warp 1.1.1.1 problemI need help ! I can't activate my VPN. When I want to activate it, the following words appear: Your how to setup custom 404 on static site(vanilla, no framework)?i want to deploy a static site using regular html, css and js, built with vite(so not totally vanillnode:path fails even with compat flagDNS Proxy for media server?I know previously the rule of thumb was disable DNS proxy when using cloudflare due to ToS breach buOrdering of zaraz.track requestsHey team! We're using Zaraz to pipe our analytics events from our browser client to GA4. We're calli