[{"data":1,"prerenderedAt":1011},["ShallowReactive",2],{"navigation":3,"/guide":56,"/guide-surround":1007},[4,30],{"title":5,"_path":6,"children":7,"icon":9},"Getting Started","/guide",[8,10,14,18,22,26],{"title":5,"_path":6,"icon":9},"ph:book-open-duotone",{"title":11,"_path":12,"icon":13},"Hooks","/guide/hooks","material-symbols-light:data-object",{"title":15,"_path":16,"icon":17},"Peer","/guide/peer","mynaui:api",{"title":19,"_path":20,"icon":21},"Message","/guide/message","solar:letter-line-duotone",{"title":23,"_path":24,"icon":25},"Pub / Sub","/guide/pubsub","simple-icons:googlepubsub",{"title":27,"_path":28,"icon":29},"Resolver API","/guide/resolver","tabler:route",{"title":31,"_path":32,"children":33,"icon":35},"Adapters","/adapters",[34,36,40,44,48,52],{"title":31,"_path":32,"icon":35},"emojione-monotone:electric-plug",{"title":37,"_path":38,"icon":39},"Bun","/adapters/bun","simple-icons:bun",{"title":41,"_path":42,"icon":43},"Cloudflare","/adapters/cloudflare","devicon-plain:cloudflareworkers",{"title":45,"_path":46,"icon":47},"Deno","/adapters/deno","teenyicons:deno-solid",{"title":49,"_path":50,"icon":51},"Node.js","/adapters/node","akar-icons:node-fill",{"title":53,"_path":54,"icon":55},"SSE","/adapters/sse","clarity:two-way-arrows-line",{"_path":6,"_dir":57,"_draft":58,"_partial":58,"_locale":57,"title":5,"description":59,"icon":9,"body":60,"_type":1001,"_id":1002,"_source":1003,"_file":1004,"_stem":1005,"_extension":1006},"",false,"crossws provides a cross-platform toolkit to define well-typed WebSocket apps that can then be integrated into various WebSocket servers using built-in adapters.",{"type":61,"children":62,"toc":997},"root",[63,71,78,116,121,845,860,874,880,901,905,910,991],{"type":64,"tag":65,"props":66,"children":67},"element","p",{},[68],{"type":69,"value":70},"text","Writing a realtime WebSocket server that can work in different runtimes is challenging because there is no single standard for WebSocket servers. You often need to go into many details of different API implementations and it also makes switching from one runtime costly. crossws is a solution to this!",{"type":64,"tag":72,"props":73,"children":75},"h2",{"id":74},"quick-start",[76],{"type":69,"value":77},"Quick Start",{"type":64,"tag":79,"props":80,"children":81},"tip",{},[82],{"type":64,"tag":65,"props":83,"children":84},{},[85,87,96,98,105,107,114],{"type":69,"value":86},"\nYou can try crossws with ",{"type":64,"tag":88,"props":89,"children":93},"a",{"href":90,"rel":91},"https://stackblitz.com/github/h3js/crossws/tree/main/examples/h3?file=app.ts",[92],"nofollow",[94],{"type":69,"value":95},"online playground",{"type":69,"value":97}," using ",{"type":64,"tag":88,"props":99,"children":102},{"href":100,"rel":101},"https://h3.unjs.io",[92],[103],{"type":69,"value":104},"h3js/h3",{"type":69,"value":106}," + ",{"type":64,"tag":88,"props":108,"children":111},{"href":109,"rel":110},"https://listhen.unjs.io",[92],[112],{"type":69,"value":113},"unjs/listhen",{"type":69,"value":115}," or alternatively integrate crossws with your own framework.",{"type":64,"tag":65,"props":117,"children":118},{},[119],{"type":69,"value":120},"A simple WebSocket implementation looks like this:",{"type":64,"tag":122,"props":123,"children":127},"pre",{"className":124,"code":125,"language":126,"meta":57,"style":57},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { defineHooks } from \"crossws\";\nimport crossws from \"crossws/adapters/\u003Cadapter>\";\n\nconst ws = crossws({\n  hooks: {\n    open(peer) {\n      console.log(\"[ws] open\", peer);\n    },\n\n    message(peer, message) {\n      console.log(\"[ws] message\", peer, message);\n      if (message.text().includes(\"ping\")) {\n        peer.send(\"pong\");\n      }\n    },\n\n    close(peer, event) {\n      console.log(\"[ws] close\", peer, event);\n    },\n\n    error(peer, error) {\n      console.log(\"[ws] error\", peer, error);\n    },\n  },\n});\n","ts",[128],{"type":64,"tag":129,"props":130,"children":131},"code",{"__ignoreMap":57},[132,187,222,232,268,288,316,370,379,387,421,478,545,588,597,605,613,647,704,712,720,754,811,819,828],{"type":64,"tag":133,"props":134,"children":137},"span",{"class":135,"line":136},"line",1,[138,144,150,156,161,166,171,177,182],{"type":64,"tag":133,"props":139,"children":141},{"style":140},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[142],{"type":69,"value":143},"import",{"type":64,"tag":133,"props":145,"children":147},{"style":146},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[148],{"type":69,"value":149}," {",{"type":64,"tag":133,"props":151,"children":153},{"style":152},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[154],{"type":69,"value":155}," defineHooks",{"type":64,"tag":133,"props":157,"children":158},{"style":146},[159],{"type":69,"value":160}," }",{"type":64,"tag":133,"props":162,"children":163},{"style":140},[164],{"type":69,"value":165}," from",{"type":64,"tag":133,"props":167,"children":168},{"style":146},[169],{"type":69,"value":170}," \"",{"type":64,"tag":133,"props":172,"children":174},{"style":173},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[175],{"type":69,"value":176},"crossws",{"type":64,"tag":133,"props":178,"children":179},{"style":146},[180],{"type":69,"value":181},"\"",{"type":64,"tag":133,"props":183,"children":184},{"style":146},[185],{"type":69,"value":186},";\n",{"type":64,"tag":133,"props":188,"children":190},{"class":135,"line":189},2,[191,195,200,205,209,214,218],{"type":64,"tag":133,"props":192,"children":193},{"style":140},[194],{"type":69,"value":143},{"type":64,"tag":133,"props":196,"children":197},{"style":152},[198],{"type":69,"value":199}," crossws ",{"type":64,"tag":133,"props":201,"children":202},{"style":140},[203],{"type":69,"value":204},"from",{"type":64,"tag":133,"props":206,"children":207},{"style":146},[208],{"type":69,"value":170},{"type":64,"tag":133,"props":210,"children":211},{"style":173},[212],{"type":69,"value":213},"crossws/adapters/\u003Cadapter>",{"type":64,"tag":133,"props":215,"children":216},{"style":146},[217],{"type":69,"value":181},{"type":64,"tag":133,"props":219,"children":220},{"style":146},[221],{"type":69,"value":186},{"type":64,"tag":133,"props":223,"children":225},{"class":135,"line":224},3,[226],{"type":64,"tag":133,"props":227,"children":229},{"emptyLinePlaceholder":228},true,[230],{"type":69,"value":231},"\n",{"type":64,"tag":133,"props":233,"children":235},{"class":135,"line":234},4,[236,242,247,252,258,263],{"type":64,"tag":133,"props":237,"children":239},{"style":238},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[240],{"type":69,"value":241},"const",{"type":64,"tag":133,"props":243,"children":244},{"style":152},[245],{"type":69,"value":246}," ws ",{"type":64,"tag":133,"props":248,"children":249},{"style":146},[250],{"type":69,"value":251},"=",{"type":64,"tag":133,"props":253,"children":255},{"style":254},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[256],{"type":69,"value":257}," crossws",{"type":64,"tag":133,"props":259,"children":260},{"style":152},[261],{"type":69,"value":262},"(",{"type":64,"tag":133,"props":264,"children":265},{"style":146},[266],{"type":69,"value":267},"{\n",{"type":64,"tag":133,"props":269,"children":271},{"class":135,"line":270},5,[272,278,283],{"type":64,"tag":133,"props":273,"children":275},{"style":274},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[276],{"type":69,"value":277},"  hooks",{"type":64,"tag":133,"props":279,"children":280},{"style":146},[281],{"type":69,"value":282},":",{"type":64,"tag":133,"props":284,"children":285},{"style":146},[286],{"type":69,"value":287}," {\n",{"type":64,"tag":133,"props":289,"children":291},{"class":135,"line":290},6,[292,297,301,307,312],{"type":64,"tag":133,"props":293,"children":294},{"style":274},[295],{"type":69,"value":296},"    open",{"type":64,"tag":133,"props":298,"children":299},{"style":146},[300],{"type":69,"value":262},{"type":64,"tag":133,"props":302,"children":304},{"style":303},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[305],{"type":69,"value":306},"peer",{"type":64,"tag":133,"props":308,"children":309},{"style":146},[310],{"type":69,"value":311},")",{"type":64,"tag":133,"props":313,"children":314},{"style":146},[315],{"type":69,"value":287},{"type":64,"tag":133,"props":317,"children":319},{"class":135,"line":318},7,[320,325,330,335,339,343,348,352,357,362,366],{"type":64,"tag":133,"props":321,"children":322},{"style":152},[323],{"type":69,"value":324},"      console",{"type":64,"tag":133,"props":326,"children":327},{"style":146},[328],{"type":69,"value":329},".",{"type":64,"tag":133,"props":331,"children":332},{"style":254},[333],{"type":69,"value":334},"log",{"type":64,"tag":133,"props":336,"children":337},{"style":274},[338],{"type":69,"value":262},{"type":64,"tag":133,"props":340,"children":341},{"style":146},[342],{"type":69,"value":181},{"type":64,"tag":133,"props":344,"children":345},{"style":173},[346],{"type":69,"value":347},"[ws] open",{"type":64,"tag":133,"props":349,"children":350},{"style":146},[351],{"type":69,"value":181},{"type":64,"tag":133,"props":353,"children":354},{"style":146},[355],{"type":69,"value":356},",",{"type":64,"tag":133,"props":358,"children":359},{"style":152},[360],{"type":69,"value":361}," peer",{"type":64,"tag":133,"props":363,"children":364},{"style":274},[365],{"type":69,"value":311},{"type":64,"tag":133,"props":367,"children":368},{"style":146},[369],{"type":69,"value":186},{"type":64,"tag":133,"props":371,"children":373},{"class":135,"line":372},8,[374],{"type":64,"tag":133,"props":375,"children":376},{"style":146},[377],{"type":69,"value":378},"    },\n",{"type":64,"tag":133,"props":380,"children":382},{"class":135,"line":381},9,[383],{"type":64,"tag":133,"props":384,"children":385},{"emptyLinePlaceholder":228},[386],{"type":69,"value":231},{"type":64,"tag":133,"props":388,"children":390},{"class":135,"line":389},10,[391,396,400,404,408,413,417],{"type":64,"tag":133,"props":392,"children":393},{"style":274},[394],{"type":69,"value":395},"    message",{"type":64,"tag":133,"props":397,"children":398},{"style":146},[399],{"type":69,"value":262},{"type":64,"tag":133,"props":401,"children":402},{"style":303},[403],{"type":69,"value":306},{"type":64,"tag":133,"props":405,"children":406},{"style":146},[407],{"type":69,"value":356},{"type":64,"tag":133,"props":409,"children":410},{"style":303},[411],{"type":69,"value":412}," message",{"type":64,"tag":133,"props":414,"children":415},{"style":146},[416],{"type":69,"value":311},{"type":64,"tag":133,"props":418,"children":419},{"style":146},[420],{"type":69,"value":287},{"type":64,"tag":133,"props":422,"children":424},{"class":135,"line":423},11,[425,429,433,437,441,445,450,454,458,462,466,470,474],{"type":64,"tag":133,"props":426,"children":427},{"style":152},[428],{"type":69,"value":324},{"type":64,"tag":133,"props":430,"children":431},{"style":146},[432],{"type":69,"value":329},{"type":64,"tag":133,"props":434,"children":435},{"style":254},[436],{"type":69,"value":334},{"type":64,"tag":133,"props":438,"children":439},{"style":274},[440],{"type":69,"value":262},{"type":64,"tag":133,"props":442,"children":443},{"style":146},[444],{"type":69,"value":181},{"type":64,"tag":133,"props":446,"children":447},{"style":173},[448],{"type":69,"value":449},"[ws] message",{"type":64,"tag":133,"props":451,"children":452},{"style":146},[453],{"type":69,"value":181},{"type":64,"tag":133,"props":455,"children":456},{"style":146},[457],{"type":69,"value":356},{"type":64,"tag":133,"props":459,"children":460},{"style":152},[461],{"type":69,"value":361},{"type":64,"tag":133,"props":463,"children":464},{"style":146},[465],{"type":69,"value":356},{"type":64,"tag":133,"props":467,"children":468},{"style":152},[469],{"type":69,"value":412},{"type":64,"tag":133,"props":471,"children":472},{"style":274},[473],{"type":69,"value":311},{"type":64,"tag":133,"props":475,"children":476},{"style":146},[477],{"type":69,"value":186},{"type":64,"tag":133,"props":479,"children":481},{"class":135,"line":480},12,[482,487,492,497,501,505,510,514,519,523,527,532,536,541],{"type":64,"tag":133,"props":483,"children":484},{"style":140},[485],{"type":69,"value":486},"      if",{"type":64,"tag":133,"props":488,"children":489},{"style":274},[490],{"type":69,"value":491}," (",{"type":64,"tag":133,"props":493,"children":494},{"style":152},[495],{"type":69,"value":496},"message",{"type":64,"tag":133,"props":498,"children":499},{"style":146},[500],{"type":69,"value":329},{"type":64,"tag":133,"props":502,"children":503},{"style":254},[504],{"type":69,"value":69},{"type":64,"tag":133,"props":506,"children":507},{"style":274},[508],{"type":69,"value":509},"()",{"type":64,"tag":133,"props":511,"children":512},{"style":146},[513],{"type":69,"value":329},{"type":64,"tag":133,"props":515,"children":516},{"style":254},[517],{"type":69,"value":518},"includes",{"type":64,"tag":133,"props":520,"children":521},{"style":274},[522],{"type":69,"value":262},{"type":64,"tag":133,"props":524,"children":525},{"style":146},[526],{"type":69,"value":181},{"type":64,"tag":133,"props":528,"children":529},{"style":173},[530],{"type":69,"value":531},"ping",{"type":64,"tag":133,"props":533,"children":534},{"style":146},[535],{"type":69,"value":181},{"type":64,"tag":133,"props":537,"children":538},{"style":274},[539],{"type":69,"value":540},")) ",{"type":64,"tag":133,"props":542,"children":543},{"style":146},[544],{"type":69,"value":267},{"type":64,"tag":133,"props":546,"children":548},{"class":135,"line":547},13,[549,554,558,563,567,571,576,580,584],{"type":64,"tag":133,"props":550,"children":551},{"style":152},[552],{"type":69,"value":553},"        peer",{"type":64,"tag":133,"props":555,"children":556},{"style":146},[557],{"type":69,"value":329},{"type":64,"tag":133,"props":559,"children":560},{"style":254},[561],{"type":69,"value":562},"send",{"type":64,"tag":133,"props":564,"children":565},{"style":274},[566],{"type":69,"value":262},{"type":64,"tag":133,"props":568,"children":569},{"style":146},[570],{"type":69,"value":181},{"type":64,"tag":133,"props":572,"children":573},{"style":173},[574],{"type":69,"value":575},"pong",{"type":64,"tag":133,"props":577,"children":578},{"style":146},[579],{"type":69,"value":181},{"type":64,"tag":133,"props":581,"children":582},{"style":274},[583],{"type":69,"value":311},{"type":64,"tag":133,"props":585,"children":586},{"style":146},[587],{"type":69,"value":186},{"type":64,"tag":133,"props":589,"children":591},{"class":135,"line":590},14,[592],{"type":64,"tag":133,"props":593,"children":594},{"style":146},[595],{"type":69,"value":596},"      }\n",{"type":64,"tag":133,"props":598,"children":600},{"class":135,"line":599},15,[601],{"type":64,"tag":133,"props":602,"children":603},{"style":146},[604],{"type":69,"value":378},{"type":64,"tag":133,"props":606,"children":608},{"class":135,"line":607},16,[609],{"type":64,"tag":133,"props":610,"children":611},{"emptyLinePlaceholder":228},[612],{"type":69,"value":231},{"type":64,"tag":133,"props":614,"children":616},{"class":135,"line":615},17,[617,622,626,630,634,639,643],{"type":64,"tag":133,"props":618,"children":619},{"style":274},[620],{"type":69,"value":621},"    close",{"type":64,"tag":133,"props":623,"children":624},{"style":146},[625],{"type":69,"value":262},{"type":64,"tag":133,"props":627,"children":628},{"style":303},[629],{"type":69,"value":306},{"type":64,"tag":133,"props":631,"children":632},{"style":146},[633],{"type":69,"value":356},{"type":64,"tag":133,"props":635,"children":636},{"style":303},[637],{"type":69,"value":638}," event",{"type":64,"tag":133,"props":640,"children":641},{"style":146},[642],{"type":69,"value":311},{"type":64,"tag":133,"props":644,"children":645},{"style":146},[646],{"type":69,"value":287},{"type":64,"tag":133,"props":648,"children":650},{"class":135,"line":649},18,[651,655,659,663,667,671,676,680,684,688,692,696,700],{"type":64,"tag":133,"props":652,"children":653},{"style":152},[654],{"type":69,"value":324},{"type":64,"tag":133,"props":656,"children":657},{"style":146},[658],{"type":69,"value":329},{"type":64,"tag":133,"props":660,"children":661},{"style":254},[662],{"type":69,"value":334},{"type":64,"tag":133,"props":664,"children":665},{"style":274},[666],{"type":69,"value":262},{"type":64,"tag":133,"props":668,"children":669},{"style":146},[670],{"type":69,"value":181},{"type":64,"tag":133,"props":672,"children":673},{"style":173},[674],{"type":69,"value":675},"[ws] close",{"type":64,"tag":133,"props":677,"children":678},{"style":146},[679],{"type":69,"value":181},{"type":64,"tag":133,"props":681,"children":682},{"style":146},[683],{"type":69,"value":356},{"type":64,"tag":133,"props":685,"children":686},{"style":152},[687],{"type":69,"value":361},{"type":64,"tag":133,"props":689,"children":690},{"style":146},[691],{"type":69,"value":356},{"type":64,"tag":133,"props":693,"children":694},{"style":152},[695],{"type":69,"value":638},{"type":64,"tag":133,"props":697,"children":698},{"style":274},[699],{"type":69,"value":311},{"type":64,"tag":133,"props":701,"children":702},{"style":146},[703],{"type":69,"value":186},{"type":64,"tag":133,"props":705,"children":707},{"class":135,"line":706},19,[708],{"type":64,"tag":133,"props":709,"children":710},{"style":146},[711],{"type":69,"value":378},{"type":64,"tag":133,"props":713,"children":715},{"class":135,"line":714},20,[716],{"type":64,"tag":133,"props":717,"children":718},{"emptyLinePlaceholder":228},[719],{"type":69,"value":231},{"type":64,"tag":133,"props":721,"children":723},{"class":135,"line":722},21,[724,729,733,737,741,746,750],{"type":64,"tag":133,"props":725,"children":726},{"style":274},[727],{"type":69,"value":728},"    error",{"type":64,"tag":133,"props":730,"children":731},{"style":146},[732],{"type":69,"value":262},{"type":64,"tag":133,"props":734,"children":735},{"style":303},[736],{"type":69,"value":306},{"type":64,"tag":133,"props":738,"children":739},{"style":146},[740],{"type":69,"value":356},{"type":64,"tag":133,"props":742,"children":743},{"style":303},[744],{"type":69,"value":745}," error",{"type":64,"tag":133,"props":747,"children":748},{"style":146},[749],{"type":69,"value":311},{"type":64,"tag":133,"props":751,"children":752},{"style":146},[753],{"type":69,"value":287},{"type":64,"tag":133,"props":755,"children":757},{"class":135,"line":756},22,[758,762,766,770,774,778,783,787,791,795,799,803,807],{"type":64,"tag":133,"props":759,"children":760},{"style":152},[761],{"type":69,"value":324},{"type":64,"tag":133,"props":763,"children":764},{"style":146},[765],{"type":69,"value":329},{"type":64,"tag":133,"props":767,"children":768},{"style":254},[769],{"type":69,"value":334},{"type":64,"tag":133,"props":771,"children":772},{"style":274},[773],{"type":69,"value":262},{"type":64,"tag":133,"props":775,"children":776},{"style":146},[777],{"type":69,"value":181},{"type":64,"tag":133,"props":779,"children":780},{"style":173},[781],{"type":69,"value":782},"[ws] error",{"type":64,"tag":133,"props":784,"children":785},{"style":146},[786],{"type":69,"value":181},{"type":64,"tag":133,"props":788,"children":789},{"style":146},[790],{"type":69,"value":356},{"type":64,"tag":133,"props":792,"children":793},{"style":152},[794],{"type":69,"value":361},{"type":64,"tag":133,"props":796,"children":797},{"style":146},[798],{"type":69,"value":356},{"type":64,"tag":133,"props":800,"children":801},{"style":152},[802],{"type":69,"value":745},{"type":64,"tag":133,"props":804,"children":805},{"style":274},[806],{"type":69,"value":311},{"type":64,"tag":133,"props":808,"children":809},{"style":146},[810],{"type":69,"value":186},{"type":64,"tag":133,"props":812,"children":814},{"class":135,"line":813},23,[815],{"type":64,"tag":133,"props":816,"children":817},{"style":146},[818],{"type":69,"value":378},{"type":64,"tag":133,"props":820,"children":822},{"class":135,"line":821},24,[823],{"type":64,"tag":133,"props":824,"children":825},{"style":146},[826],{"type":69,"value":827},"  },\n",{"type":64,"tag":133,"props":829,"children":831},{"class":135,"line":830},25,[832,837,841],{"type":64,"tag":133,"props":833,"children":834},{"style":146},[835],{"type":69,"value":836},"}",{"type":64,"tag":133,"props":838,"children":839},{"style":152},[840],{"type":69,"value":311},{"type":64,"tag":133,"props":842,"children":843},{"style":146},[844],{"type":69,"value":186},{"type":64,"tag":846,"props":847,"children":848},"read-more",{"title":11,"to":12},[849],{"type":64,"tag":65,"props":850,"children":851},{},[852,854,858],{"type":69,"value":853},"See ",{"type":64,"tag":88,"props":855,"children":856},{"href":12},[857],{"type":69,"value":11},{"type":69,"value":859}," for more usage details.",{"type":64,"tag":846,"props":861,"children":862},{"title":31,"to":32},[863],{"type":64,"tag":65,"props":864,"children":865},{},[866,868,872],{"type":69,"value":867},"Hooks API is exactly same on all runtimes. See ",{"type":64,"tag":88,"props":869,"children":870},{"href":32},[871],{"type":69,"value":31},{"type":69,"value":873}," for integration details.",{"type":64,"tag":72,"props":875,"children":877},{"id":876},"using-package",[878],{"type":69,"value":879},"Using Package",{"type":64,"tag":65,"props":881,"children":882},{},[883,885,890,892,899],{"type":69,"value":884},"You can install ",{"type":64,"tag":129,"props":886,"children":888},{"className":887},[],[889],{"type":69,"value":176},{"type":69,"value":891}," from ",{"type":64,"tag":88,"props":893,"children":896},{"href":894,"rel":895},"https://npmjs.com/crossws",[92],[897],{"type":69,"value":898},"npm",{"type":69,"value":900}," in your project:",{"type":64,"tag":902,"props":903,"children":904},"pm-install",{"name":176},[],{"type":64,"tag":65,"props":906,"children":907},{},[908],{"type":69,"value":909},"Alternatively you can import it from CDN:",{"type":64,"tag":122,"props":911,"children":915},{"className":912,"code":913,"language":914,"meta":57,"style":57},"language-js shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { defineHooks } from \"https://esm.sh/crossws\";\nimport crossws from \"https://esm.sh/crossws/adapters/\u003Cadapter>\";\n","js",[916],{"type":64,"tag":129,"props":917,"children":918},{"__ignoreMap":57},[919,959],{"type":64,"tag":133,"props":920,"children":921},{"class":135,"line":136},[922,926,930,934,938,942,946,951,955],{"type":64,"tag":133,"props":923,"children":924},{"style":140},[925],{"type":69,"value":143},{"type":64,"tag":133,"props":927,"children":928},{"style":146},[929],{"type":69,"value":149},{"type":64,"tag":133,"props":931,"children":932},{"style":152},[933],{"type":69,"value":155},{"type":64,"tag":133,"props":935,"children":936},{"style":146},[937],{"type":69,"value":160},{"type":64,"tag":133,"props":939,"children":940},{"style":140},[941],{"type":69,"value":165},{"type":64,"tag":133,"props":943,"children":944},{"style":146},[945],{"type":69,"value":170},{"type":64,"tag":133,"props":947,"children":948},{"style":173},[949],{"type":69,"value":950},"https://esm.sh/crossws",{"type":64,"tag":133,"props":952,"children":953},{"style":146},[954],{"type":69,"value":181},{"type":64,"tag":133,"props":956,"children":957},{"style":146},[958],{"type":69,"value":186},{"type":64,"tag":133,"props":960,"children":961},{"class":135,"line":189},[962,966,970,974,978,983,987],{"type":64,"tag":133,"props":963,"children":964},{"style":140},[965],{"type":69,"value":143},{"type":64,"tag":133,"props":967,"children":968},{"style":152},[969],{"type":69,"value":199},{"type":64,"tag":133,"props":971,"children":972},{"style":140},[973],{"type":69,"value":204},{"type":64,"tag":133,"props":975,"children":976},{"style":146},[977],{"type":69,"value":170},{"type":64,"tag":133,"props":979,"children":980},{"style":173},[981],{"type":69,"value":982},"https://esm.sh/crossws/adapters/\u003Cadapter>",{"type":64,"tag":133,"props":984,"children":985},{"style":146},[986],{"type":69,"value":181},{"type":64,"tag":133,"props":988,"children":989},{"style":146},[990],{"type":69,"value":186},{"type":64,"tag":992,"props":993,"children":994},"style",{},[995],{"type":69,"value":996},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":57,"searchDepth":189,"depth":189,"links":998},[999,1000],{"id":74,"depth":189,"text":77},{"id":876,"depth":189,"text":879},"markdown","content:1.guide:1.index.md","content","1.guide/1.index.md","1.guide/1.index","md",[1008,1009],null,{"_path":12,"title":11,"description":1010},"Using hooks, you can define a WebSocket server that works across runtimes with the same syntax.",1747776030680]