[{"data":1,"prerenderedAt":209},["ShallowReactive",2],{"navigation":3,"-adapters":88,"-adapters-surround":204},[4,51],{"title":5,"path":6,"stem":7,"children":8,"icon":10},"Guide","\u002Fguide","1.guide\u002F1.index",[9,11,16,21,26,31,36,41,46],{"title":5,"path":6,"stem":7,"icon":10},"ph:book-open-duotone",{"title":12,"path":13,"stem":14,"icon":15},"Hooks","\u002Fguide\u002Fhooks","1.guide\u002F2.hooks","material-symbols-light:data-object",{"title":17,"path":18,"stem":19,"icon":20},"Peer","\u002Fguide\u002Fpeer","1.guide\u002F3.peer","mynaui:api",{"title":22,"path":23,"stem":24,"icon":25},"Message","\u002Fguide\u002Fmessage","1.guide\u002F4.message","solar:letter-line-duotone",{"title":27,"path":28,"stem":29,"icon":30},"Pub \u002F Sub","\u002Fguide\u002Fpubsub","1.guide\u002F5.pubsub","simple-icons:googlepubsub",{"title":32,"path":33,"stem":34,"icon":35},"Sync Backplane","\u002Fguide\u002Fsync","1.guide\u002F6.sync","tabler:refresh",{"title":37,"path":38,"stem":39,"icon":40},"Resolver API","\u002Fguide\u002Fresolver","1.guide\u002F7.resolver","tabler:route",{"title":42,"path":43,"stem":44,"icon":45},"WebSocket Proxy","\u002Fguide\u002Fproxy","1.guide\u002F8.proxy","tabler:arrows-exchange",{"title":47,"path":48,"stem":49,"icon":50},"WebSocket Client","\u002Fguide\u002Fclient","1.guide\u002F9.client","tabler:plug-connected",{"title":52,"path":53,"stem":54,"children":55,"icon":57},"Adapters","\u002Fadapters","2.adapters\u002F1.index",[56,58,63,68,73,78,83],{"title":52,"path":53,"stem":54,"icon":57},"emojione-monotone:electric-plug",{"title":59,"path":60,"stem":61,"icon":62},"Bun","\u002Fadapters\u002Fbun","2.adapters\u002Fbun","simple-icons:bun",{"title":64,"path":65,"stem":66,"icon":67},"Bunny","\u002Fadapters\u002Fbunny","2.adapters\u002Fbunny","mdi:rabbit",{"title":69,"path":70,"stem":71,"icon":72},"Cloudflare","\u002Fadapters\u002Fcloudflare","2.adapters\u002Fcloudflare","devicon-plain:cloudflareworkers",{"title":74,"path":75,"stem":76,"icon":77},"Deno","\u002Fadapters\u002Fdeno","2.adapters\u002Fdeno","teenyicons:deno-solid",{"title":79,"path":80,"stem":81,"icon":82},"Node.js","\u002Fadapters\u002Fnode","2.adapters\u002Fnode","akar-icons:node-fill",{"title":84,"path":85,"stem":86,"icon":87},"SSE","\u002Fadapters\u002Fsse","2.adapters\u002Fsse","clarity:two-way-arrows-line",{"id":89,"title":52,"body":90,"description":192,"extension":199,"meta":200,"navigation":201,"path":53,"seo":202,"stem":54,"__hash__":203},"content\u002F2.adapters\u002F1.index.md",{"type":91,"value":92,"toc":191,"icon":57},"minimark",[93,97,100,105,108,116,137,140,160,177],[94,95,96],"p",{},"crossws allows integrating your WebSocket hooks with different runtimes and platforms using built-in adapters. Each runtime has a specific method of integrating WebSocket. Once integrated, will work consistently even if you change the runtime.",[94,98,99],{},"See Adapters section to learn more about all available built-in adapters.",[101,102,104],"h2",{"id":103},"shared-options","Shared options",[94,106,107],{},"Every adapter accepts these options in addition to its runtime-specific ones.",[109,110,112],"h3",{"id":111},"idletimeout",[113,114,115],"code",{},"idleTimeout",[94,117,118,119,123,124,127,128,131,132,136],{},"Close a connection that has stayed idle — no incoming messages and no pong replies — for roughly this many ",[120,121,122],"strong",{},"seconds",". This reclaims peers whose transport died silently (\"half-open\" sockets: laptop sleep, NAT\u002Fmobile idle timeout, power loss, a cut cable) without the TCP stack ever delivering a ",[113,125,126],{},"FIN","\u002F",[113,129,130],{},"RST",", which would otherwise leak forever (the peer, and anything it owns such as a ",[133,134,135],"a",{"href":43},"proxied upstream"," connection).",[94,138,139],{},"It maps to each runtime's liveness mechanism behind one consistent knob:",[141,142,143,154],"ul",{},[144,145,146,149,150,153],"li",{},[120,147,148],{},"Node"," — the ",[113,151,152],{},"ws"," library has no built-in liveness, so crossws pings each peer on this interval and terminates any that miss the pong.",[144,155,156,159],{},[120,157,158],{},"Bun \u002F Deno \u002F uWebSockets \u002F Bunny"," — mapped to the runtime's native WebSocket idle timeout, which also auto-sends keepalive pings.",[94,161,162,163,166,167,170,171,127,173,176],{},"Terminated peers surface through the normal ",[113,164,165],{},"close"," hook (Node reports code ",[113,168,169],{},"1006","), so ",[113,172,165],{},[113,174,175],{},"error"," teardown runs unchanged.",[94,178,179,186,187,190],{},[120,180,181,182,185],{},"Defaults to ",[113,183,184],{},"30"," (seconds) on every runtime."," 30s stays under the common ~60s reverse-proxy \u002F load-balancer idle timeout (so idle-but-alive connections aren't dropped) while reclaiming dead sockets promptly; pings are a few bytes and standards clients auto-pong, so a live connection is never disconnected. Set to ",[113,188,189],{},"0"," to disable.",{"title":192,"searchDepth":193,"depth":193,"links":194},"",2,[195],{"id":103,"depth":193,"text":104,"children":196},[197],{"id":111,"depth":198,"text":115},3,"md",{"icon":57},{"icon":57},{"title":52,"description":192},"RIyYvbFQ_FPAKoxgfPw2xpW4UnSfeqTisw3SGCWM_jM",[205,207],{"title":47,"path":48,"stem":49,"description":206,"icon":50,"children":-1},"A per-runtime WebSocket client for dialing upstream servers with one consistent signature.",{"title":59,"path":60,"stem":61,"description":208,"icon":62,"children":-1},"Manually integrate crossws with Bun.",1783073586613]