[{"data":1,"prerenderedAt":2233},["ShallowReactive",2],{"navigation":3,"/adapters/cloudflare":56,"/adapters/cloudflare-surround":2228},[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":42,"_dir":57,"_draft":58,"_partial":58,"_locale":59,"title":41,"description":60,"icon":43,"body":61,"_type":2222,"_id":2223,"_source":2224,"_file":2225,"_stem":2226,"_extension":2227},"adapters",false,"","Integrate crossws with Cloudflare Workers.",{"type":62,"children":63,"toc":2217},"root",[64,81,106,650,686,692,713,1907,1920,2070,2101,2108,2148,2211],{"type":65,"tag":66,"props":67,"children":68},"element","p",{},[69,72,79],{"type":70,"value":71},"text","To integrate crossws with your Cloudflare Workers, you need to check for the ",{"type":65,"tag":73,"props":74,"children":76},"code",{"className":75},[],[77],{"type":70,"value":78},"upgrade",{"type":70,"value":80}," header.",{"type":65,"tag":82,"props":83,"children":84},"important",{},[85],{"type":65,"tag":66,"props":86,"children":87},{},[88,90,96,98,104],{"type":70,"value":89},"\nFor ",{"type":65,"tag":91,"props":92,"children":93},"a",{"href":24},[94],{"type":70,"value":95},"pub/sub",{"type":70,"value":97}," support, you need to use ",{"type":65,"tag":91,"props":99,"children":101},{"href":100},"#durable-objects",[102],{"type":70,"value":103},"Durable objects",{"type":70,"value":105},".",{"type":65,"tag":107,"props":108,"children":112},"pre",{"className":109,"code":110,"language":111,"meta":59,"style":59},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import crossws from \"crossws/adapters/cloudflare\";\n\nconst ws = crossws({\n  hooks: {\n    message: console.log,\n  },\n});\n\nexport default {\n  async fetch(request, env, context) {\n    if (request.headers.get(\"upgrade\") === \"websocket\") {\n      return ws.handleUpgrade(request, env, context);\n    }\n    return new Response(\n      `\u003Cscript>new WebSocket(\"ws://localhost:3000\").addEventListener(\"open\", (e) => e.target.send(\"Hello from client!\"));\u003C/script>`,\n      { headers: { \"content-type\": \"text/html\" } },\n    );\n  },\n};\n","ts",[113],{"type":65,"tag":73,"props":114,"children":115},{"__ignoreMap":59},[116,161,171,207,227,259,268,286,294,312,363,446,501,510,534,557,620,633,641],{"type":65,"tag":117,"props":118,"children":121},"span",{"class":119,"line":120},"line",1,[122,128,134,139,145,151,156],{"type":65,"tag":117,"props":123,"children":125},{"style":124},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[126],{"type":70,"value":127},"import",{"type":65,"tag":117,"props":129,"children":131},{"style":130},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[132],{"type":70,"value":133}," crossws ",{"type":65,"tag":117,"props":135,"children":136},{"style":124},[137],{"type":70,"value":138},"from",{"type":65,"tag":117,"props":140,"children":142},{"style":141},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[143],{"type":70,"value":144}," \"",{"type":65,"tag":117,"props":146,"children":148},{"style":147},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[149],{"type":70,"value":150},"crossws/adapters/cloudflare",{"type":65,"tag":117,"props":152,"children":153},{"style":141},[154],{"type":70,"value":155},"\"",{"type":65,"tag":117,"props":157,"children":158},{"style":141},[159],{"type":70,"value":160},";\n",{"type":65,"tag":117,"props":162,"children":164},{"class":119,"line":163},2,[165],{"type":65,"tag":117,"props":166,"children":168},{"emptyLinePlaceholder":167},true,[169],{"type":70,"value":170},"\n",{"type":65,"tag":117,"props":172,"children":174},{"class":119,"line":173},3,[175,181,186,191,197,202],{"type":65,"tag":117,"props":176,"children":178},{"style":177},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[179],{"type":70,"value":180},"const",{"type":65,"tag":117,"props":182,"children":183},{"style":130},[184],{"type":70,"value":185}," ws ",{"type":65,"tag":117,"props":187,"children":188},{"style":141},[189],{"type":70,"value":190},"=",{"type":65,"tag":117,"props":192,"children":194},{"style":193},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[195],{"type":70,"value":196}," crossws",{"type":65,"tag":117,"props":198,"children":199},{"style":130},[200],{"type":70,"value":201},"(",{"type":65,"tag":117,"props":203,"children":204},{"style":141},[205],{"type":70,"value":206},"{\n",{"type":65,"tag":117,"props":208,"children":210},{"class":119,"line":209},4,[211,217,222],{"type":65,"tag":117,"props":212,"children":214},{"style":213},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[215],{"type":70,"value":216},"  hooks",{"type":65,"tag":117,"props":218,"children":219},{"style":141},[220],{"type":70,"value":221},":",{"type":65,"tag":117,"props":223,"children":224},{"style":141},[225],{"type":70,"value":226}," {\n",{"type":65,"tag":117,"props":228,"children":230},{"class":119,"line":229},5,[231,236,240,245,249,254],{"type":65,"tag":117,"props":232,"children":233},{"style":213},[234],{"type":70,"value":235},"    message",{"type":65,"tag":117,"props":237,"children":238},{"style":141},[239],{"type":70,"value":221},{"type":65,"tag":117,"props":241,"children":242},{"style":130},[243],{"type":70,"value":244}," console",{"type":65,"tag":117,"props":246,"children":247},{"style":141},[248],{"type":70,"value":105},{"type":65,"tag":117,"props":250,"children":251},{"style":130},[252],{"type":70,"value":253},"log",{"type":65,"tag":117,"props":255,"children":256},{"style":141},[257],{"type":70,"value":258},",\n",{"type":65,"tag":117,"props":260,"children":262},{"class":119,"line":261},6,[263],{"type":65,"tag":117,"props":264,"children":265},{"style":141},[266],{"type":70,"value":267},"  },\n",{"type":65,"tag":117,"props":269,"children":271},{"class":119,"line":270},7,[272,277,282],{"type":65,"tag":117,"props":273,"children":274},{"style":141},[275],{"type":70,"value":276},"}",{"type":65,"tag":117,"props":278,"children":279},{"style":130},[280],{"type":70,"value":281},")",{"type":65,"tag":117,"props":283,"children":284},{"style":141},[285],{"type":70,"value":160},{"type":65,"tag":117,"props":287,"children":289},{"class":119,"line":288},8,[290],{"type":65,"tag":117,"props":291,"children":292},{"emptyLinePlaceholder":167},[293],{"type":70,"value":170},{"type":65,"tag":117,"props":295,"children":297},{"class":119,"line":296},9,[298,303,308],{"type":65,"tag":117,"props":299,"children":300},{"style":124},[301],{"type":70,"value":302},"export",{"type":65,"tag":117,"props":304,"children":305},{"style":124},[306],{"type":70,"value":307}," default",{"type":65,"tag":117,"props":309,"children":310},{"style":141},[311],{"type":70,"value":226},{"type":65,"tag":117,"props":313,"children":315},{"class":119,"line":314},10,[316,321,326,330,336,341,346,350,355,359],{"type":65,"tag":117,"props":317,"children":318},{"style":177},[319],{"type":70,"value":320},"  async",{"type":65,"tag":117,"props":322,"children":323},{"style":213},[324],{"type":70,"value":325}," fetch",{"type":65,"tag":117,"props":327,"children":328},{"style":141},[329],{"type":70,"value":201},{"type":65,"tag":117,"props":331,"children":333},{"style":332},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[334],{"type":70,"value":335},"request",{"type":65,"tag":117,"props":337,"children":338},{"style":141},[339],{"type":70,"value":340},",",{"type":65,"tag":117,"props":342,"children":343},{"style":332},[344],{"type":70,"value":345}," env",{"type":65,"tag":117,"props":347,"children":348},{"style":141},[349],{"type":70,"value":340},{"type":65,"tag":117,"props":351,"children":352},{"style":332},[353],{"type":70,"value":354}," context",{"type":65,"tag":117,"props":356,"children":357},{"style":141},[358],{"type":70,"value":281},{"type":65,"tag":117,"props":360,"children":361},{"style":141},[362],{"type":70,"value":226},{"type":65,"tag":117,"props":364,"children":366},{"class":119,"line":365},11,[367,372,377,381,385,390,394,399,403,407,411,415,420,425,429,434,438,442],{"type":65,"tag":117,"props":368,"children":369},{"style":124},[370],{"type":70,"value":371},"    if",{"type":65,"tag":117,"props":373,"children":374},{"style":213},[375],{"type":70,"value":376}," (",{"type":65,"tag":117,"props":378,"children":379},{"style":130},[380],{"type":70,"value":335},{"type":65,"tag":117,"props":382,"children":383},{"style":141},[384],{"type":70,"value":105},{"type":65,"tag":117,"props":386,"children":387},{"style":130},[388],{"type":70,"value":389},"headers",{"type":65,"tag":117,"props":391,"children":392},{"style":141},[393],{"type":70,"value":105},{"type":65,"tag":117,"props":395,"children":396},{"style":193},[397],{"type":70,"value":398},"get",{"type":65,"tag":117,"props":400,"children":401},{"style":213},[402],{"type":70,"value":201},{"type":65,"tag":117,"props":404,"children":405},{"style":141},[406],{"type":70,"value":155},{"type":65,"tag":117,"props":408,"children":409},{"style":147},[410],{"type":70,"value":78},{"type":65,"tag":117,"props":412,"children":413},{"style":141},[414],{"type":70,"value":155},{"type":65,"tag":117,"props":416,"children":417},{"style":213},[418],{"type":70,"value":419},") ",{"type":65,"tag":117,"props":421,"children":422},{"style":141},[423],{"type":70,"value":424},"===",{"type":65,"tag":117,"props":426,"children":427},{"style":141},[428],{"type":70,"value":144},{"type":65,"tag":117,"props":430,"children":431},{"style":147},[432],{"type":70,"value":433},"websocket",{"type":65,"tag":117,"props":435,"children":436},{"style":141},[437],{"type":70,"value":155},{"type":65,"tag":117,"props":439,"children":440},{"style":213},[441],{"type":70,"value":419},{"type":65,"tag":117,"props":443,"children":444},{"style":141},[445],{"type":70,"value":206},{"type":65,"tag":117,"props":447,"children":449},{"class":119,"line":448},12,[450,455,460,464,469,473,477,481,485,489,493,497],{"type":65,"tag":117,"props":451,"children":452},{"style":124},[453],{"type":70,"value":454},"      return",{"type":65,"tag":117,"props":456,"children":457},{"style":130},[458],{"type":70,"value":459}," ws",{"type":65,"tag":117,"props":461,"children":462},{"style":141},[463],{"type":70,"value":105},{"type":65,"tag":117,"props":465,"children":466},{"style":193},[467],{"type":70,"value":468},"handleUpgrade",{"type":65,"tag":117,"props":470,"children":471},{"style":213},[472],{"type":70,"value":201},{"type":65,"tag":117,"props":474,"children":475},{"style":130},[476],{"type":70,"value":335},{"type":65,"tag":117,"props":478,"children":479},{"style":141},[480],{"type":70,"value":340},{"type":65,"tag":117,"props":482,"children":483},{"style":130},[484],{"type":70,"value":345},{"type":65,"tag":117,"props":486,"children":487},{"style":141},[488],{"type":70,"value":340},{"type":65,"tag":117,"props":490,"children":491},{"style":130},[492],{"type":70,"value":354},{"type":65,"tag":117,"props":494,"children":495},{"style":213},[496],{"type":70,"value":281},{"type":65,"tag":117,"props":498,"children":499},{"style":141},[500],{"type":70,"value":160},{"type":65,"tag":117,"props":502,"children":504},{"class":119,"line":503},13,[505],{"type":65,"tag":117,"props":506,"children":507},{"style":141},[508],{"type":70,"value":509},"    }\n",{"type":65,"tag":117,"props":511,"children":513},{"class":119,"line":512},14,[514,519,524,529],{"type":65,"tag":117,"props":515,"children":516},{"style":124},[517],{"type":70,"value":518},"    return",{"type":65,"tag":117,"props":520,"children":521},{"style":141},[522],{"type":70,"value":523}," new",{"type":65,"tag":117,"props":525,"children":526},{"style":193},[527],{"type":70,"value":528}," Response",{"type":65,"tag":117,"props":530,"children":531},{"style":213},[532],{"type":70,"value":533},"(\n",{"type":65,"tag":117,"props":535,"children":537},{"class":119,"line":536},15,[538,543,548,553],{"type":65,"tag":117,"props":539,"children":540},{"style":141},[541],{"type":70,"value":542},"      `",{"type":65,"tag":117,"props":544,"children":545},{"style":147},[546],{"type":70,"value":547},"\u003Cscript>new WebSocket(\"ws://localhost:3000\").addEventListener(\"open\", (e) => e.target.send(\"Hello from client!\"));\u003C/script>",{"type":65,"tag":117,"props":549,"children":550},{"style":141},[551],{"type":70,"value":552},"`",{"type":65,"tag":117,"props":554,"children":555},{"style":141},[556],{"type":70,"value":258},{"type":65,"tag":117,"props":558,"children":560},{"class":119,"line":559},16,[561,566,571,575,580,584,589,593,597,601,606,610,615],{"type":65,"tag":117,"props":562,"children":563},{"style":141},[564],{"type":70,"value":565},"      {",{"type":65,"tag":117,"props":567,"children":568},{"style":213},[569],{"type":70,"value":570}," headers",{"type":65,"tag":117,"props":572,"children":573},{"style":141},[574],{"type":70,"value":221},{"type":65,"tag":117,"props":576,"children":577},{"style":141},[578],{"type":70,"value":579}," {",{"type":65,"tag":117,"props":581,"children":582},{"style":141},[583],{"type":70,"value":144},{"type":65,"tag":117,"props":585,"children":586},{"style":213},[587],{"type":70,"value":588},"content-type",{"type":65,"tag":117,"props":590,"children":591},{"style":141},[592],{"type":70,"value":155},{"type":65,"tag":117,"props":594,"children":595},{"style":141},[596],{"type":70,"value":221},{"type":65,"tag":117,"props":598,"children":599},{"style":141},[600],{"type":70,"value":144},{"type":65,"tag":117,"props":602,"children":603},{"style":147},[604],{"type":70,"value":605},"text/html",{"type":65,"tag":117,"props":607,"children":608},{"style":141},[609],{"type":70,"value":155},{"type":65,"tag":117,"props":611,"children":612},{"style":141},[613],{"type":70,"value":614}," }",{"type":65,"tag":117,"props":616,"children":617},{"style":141},[618],{"type":70,"value":619}," },\n",{"type":65,"tag":117,"props":621,"children":623},{"class":119,"line":622},17,[624,629],{"type":65,"tag":117,"props":625,"children":626},{"style":213},[627],{"type":70,"value":628},"    )",{"type":65,"tag":117,"props":630,"children":631},{"style":141},[632],{"type":70,"value":160},{"type":65,"tag":117,"props":634,"children":636},{"class":119,"line":635},18,[637],{"type":65,"tag":117,"props":638,"children":639},{"style":141},[640],{"type":70,"value":267},{"type":65,"tag":117,"props":642,"children":644},{"class":119,"line":643},19,[645],{"type":65,"tag":117,"props":646,"children":647},{"style":141},[648],{"type":70,"value":649},"};\n",{"type":65,"tag":651,"props":652,"children":653},"read-more",{},[654],{"type":65,"tag":66,"props":655,"children":656},{},[657,659,671,673,684],{"type":70,"value":658},"See ",{"type":65,"tag":91,"props":660,"children":664},{"href":661,"rel":662},"https://github.com/h3js/crossws/blob/main/test/fixture/cloudflare.ts",[663],"nofollow",[665],{"type":65,"tag":73,"props":666,"children":668},{"className":667},[],[669],{"type":70,"value":670},"test/fixture/cloudflare.ts",{"type":70,"value":672}," for demo and ",{"type":65,"tag":91,"props":674,"children":677},{"href":675,"rel":676},"https://github.com/h3js/crossws/blob/main/src/adapters/cloudflare.ts",[663],[678],{"type":65,"tag":73,"props":679,"children":681},{"className":680},[],[682],{"type":70,"value":683},"src/adapters/cloudflare.ts",{"type":70,"value":685}," for implementation.",{"type":65,"tag":687,"props":688,"children":690},"h2",{"id":689},"durable-objects",[691],{"type":70,"value":103},{"type":65,"tag":66,"props":693,"children":694},{},[695,697,704,706,711],{"type":70,"value":696},"To integrate crossws with Cloudflare ",{"type":65,"tag":91,"props":698,"children":701},{"href":699,"rel":700},"https://developers.cloudflare.com/durable-objects/api/websockets/",[663],[702],{"type":70,"value":703},"Durable Objects",{"type":70,"value":705}," (available on paid plans) with pub/sub and hibernation support, you need to check for the ",{"type":65,"tag":73,"props":707,"children":709},{"className":708},[],[710],{"type":70,"value":78},{"type":70,"value":712}," header and additionally export a Durable object with crossws adapter hooks integrated.",{"type":65,"tag":107,"props":714,"children":718},{"className":715,"code":716,"language":717,"meta":59,"style":59},"language-js shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { DurableObject } from \"cloudflare:workers\";\nimport crossws from \"crossws/adapters/cloudflare-durable\";\n\nconst ws = crossws({\n  // bindingName: \"$DurableObject\",\n  // instanceName: \"crossws\",\n  hooks: {\n    message: console.log,\n    open(peer) {\n      peer.subscribe(\"chat\");\n      peer.publish(\"chat\", { user: \"server\", message: `${peer} joined!` });\n    },\n  },\n});\n\nexport default {\n  async fetch(request, env, context) {\n    if (request.headers.get(\"upgrade\") === \"websocket\") {\n      return ws.handleUpgrade(request, env, context);\n    }\n    return new Response(\n      `\u003Cscript>new WebSocket(\"ws://localhost:3000\").addEventListener(\"open\", (e) => e.target.send(\"Hello from client!\"));\u003C/script>`,\n      { headers: { \"content-type\": \"text/html\" } },\n    );\n  },\n};\n\nexport class $DurableObject extends DurableObject {\n  constructor(state, env) {\n    super(state, env);\n    ws.handleDurableInit(this, state, env);\n  }\n\n  fetch(request) {\n    return ws.handleDurableUpgrade(this, request);\n  }\n\n  webSocketMessage(client, message) {\n    return ws.handleDurableMessage(this, client, message);\n  }\n\n  webSocketClose(client, code, reason, wasClean) {\n    return ws.handleDurableClose(this, client, code, reason, wasClean);\n  }\n}\n","js",[719],{"type":65,"tag":73,"props":720,"children":721},{"__ignoreMap":59},[722,764,796,803,830,839,847,862,889,914,956,1065,1073,1080,1095,1102,1117,1160,1235,1286,1294,1314,1334,1390,1402,1410,1418,1426,1458,1492,1525,1573,1582,1590,1615,1657,1665,1673,1707,1757,1765,1773,1825,1890,1898],{"type":65,"tag":117,"props":723,"children":724},{"class":119,"line":120},[725,729,733,738,742,747,751,756,760],{"type":65,"tag":117,"props":726,"children":727},{"style":124},[728],{"type":70,"value":127},{"type":65,"tag":117,"props":730,"children":731},{"style":141},[732],{"type":70,"value":579},{"type":65,"tag":117,"props":734,"children":735},{"style":130},[736],{"type":70,"value":737}," DurableObject",{"type":65,"tag":117,"props":739,"children":740},{"style":141},[741],{"type":70,"value":614},{"type":65,"tag":117,"props":743,"children":744},{"style":124},[745],{"type":70,"value":746}," from",{"type":65,"tag":117,"props":748,"children":749},{"style":141},[750],{"type":70,"value":144},{"type":65,"tag":117,"props":752,"children":753},{"style":147},[754],{"type":70,"value":755},"cloudflare:workers",{"type":65,"tag":117,"props":757,"children":758},{"style":141},[759],{"type":70,"value":155},{"type":65,"tag":117,"props":761,"children":762},{"style":141},[763],{"type":70,"value":160},{"type":65,"tag":117,"props":765,"children":766},{"class":119,"line":163},[767,771,775,779,783,788,792],{"type":65,"tag":117,"props":768,"children":769},{"style":124},[770],{"type":70,"value":127},{"type":65,"tag":117,"props":772,"children":773},{"style":130},[774],{"type":70,"value":133},{"type":65,"tag":117,"props":776,"children":777},{"style":124},[778],{"type":70,"value":138},{"type":65,"tag":117,"props":780,"children":781},{"style":141},[782],{"type":70,"value":144},{"type":65,"tag":117,"props":784,"children":785},{"style":147},[786],{"type":70,"value":787},"crossws/adapters/cloudflare-durable",{"type":65,"tag":117,"props":789,"children":790},{"style":141},[791],{"type":70,"value":155},{"type":65,"tag":117,"props":793,"children":794},{"style":141},[795],{"type":70,"value":160},{"type":65,"tag":117,"props":797,"children":798},{"class":119,"line":173},[799],{"type":65,"tag":117,"props":800,"children":801},{"emptyLinePlaceholder":167},[802],{"type":70,"value":170},{"type":65,"tag":117,"props":804,"children":805},{"class":119,"line":209},[806,810,814,818,822,826],{"type":65,"tag":117,"props":807,"children":808},{"style":177},[809],{"type":70,"value":180},{"type":65,"tag":117,"props":811,"children":812},{"style":130},[813],{"type":70,"value":185},{"type":65,"tag":117,"props":815,"children":816},{"style":141},[817],{"type":70,"value":190},{"type":65,"tag":117,"props":819,"children":820},{"style":193},[821],{"type":70,"value":196},{"type":65,"tag":117,"props":823,"children":824},{"style":130},[825],{"type":70,"value":201},{"type":65,"tag":117,"props":827,"children":828},{"style":141},[829],{"type":70,"value":206},{"type":65,"tag":117,"props":831,"children":832},{"class":119,"line":229},[833],{"type":65,"tag":117,"props":834,"children":836},{"style":835},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[837],{"type":70,"value":838},"  // bindingName: \"$DurableObject\",\n",{"type":65,"tag":117,"props":840,"children":841},{"class":119,"line":261},[842],{"type":65,"tag":117,"props":843,"children":844},{"style":835},[845],{"type":70,"value":846},"  // instanceName: \"crossws\",\n",{"type":65,"tag":117,"props":848,"children":849},{"class":119,"line":270},[850,854,858],{"type":65,"tag":117,"props":851,"children":852},{"style":213},[853],{"type":70,"value":216},{"type":65,"tag":117,"props":855,"children":856},{"style":141},[857],{"type":70,"value":221},{"type":65,"tag":117,"props":859,"children":860},{"style":141},[861],{"type":70,"value":226},{"type":65,"tag":117,"props":863,"children":864},{"class":119,"line":288},[865,869,873,877,881,885],{"type":65,"tag":117,"props":866,"children":867},{"style":213},[868],{"type":70,"value":235},{"type":65,"tag":117,"props":870,"children":871},{"style":141},[872],{"type":70,"value":221},{"type":65,"tag":117,"props":874,"children":875},{"style":130},[876],{"type":70,"value":244},{"type":65,"tag":117,"props":878,"children":879},{"style":141},[880],{"type":70,"value":105},{"type":65,"tag":117,"props":882,"children":883},{"style":130},[884],{"type":70,"value":253},{"type":65,"tag":117,"props":886,"children":887},{"style":141},[888],{"type":70,"value":258},{"type":65,"tag":117,"props":890,"children":891},{"class":119,"line":296},[892,897,901,906,910],{"type":65,"tag":117,"props":893,"children":894},{"style":213},[895],{"type":70,"value":896},"    open",{"type":65,"tag":117,"props":898,"children":899},{"style":141},[900],{"type":70,"value":201},{"type":65,"tag":117,"props":902,"children":903},{"style":332},[904],{"type":70,"value":905},"peer",{"type":65,"tag":117,"props":907,"children":908},{"style":141},[909],{"type":70,"value":281},{"type":65,"tag":117,"props":911,"children":912},{"style":141},[913],{"type":70,"value":226},{"type":65,"tag":117,"props":915,"children":916},{"class":119,"line":314},[917,922,926,931,935,939,944,948,952],{"type":65,"tag":117,"props":918,"children":919},{"style":130},[920],{"type":70,"value":921},"      peer",{"type":65,"tag":117,"props":923,"children":924},{"style":141},[925],{"type":70,"value":105},{"type":65,"tag":117,"props":927,"children":928},{"style":193},[929],{"type":70,"value":930},"subscribe",{"type":65,"tag":117,"props":932,"children":933},{"style":213},[934],{"type":70,"value":201},{"type":65,"tag":117,"props":936,"children":937},{"style":141},[938],{"type":70,"value":155},{"type":65,"tag":117,"props":940,"children":941},{"style":147},[942],{"type":70,"value":943},"chat",{"type":65,"tag":117,"props":945,"children":946},{"style":141},[947],{"type":70,"value":155},{"type":65,"tag":117,"props":949,"children":950},{"style":213},[951],{"type":70,"value":281},{"type":65,"tag":117,"props":953,"children":954},{"style":141},[955],{"type":70,"value":160},{"type":65,"tag":117,"props":957,"children":958},{"class":119,"line":365},[959,963,967,972,976,980,984,988,992,996,1001,1005,1009,1014,1018,1022,1027,1031,1036,1040,1044,1049,1053,1057,1061],{"type":65,"tag":117,"props":960,"children":961},{"style":130},[962],{"type":70,"value":921},{"type":65,"tag":117,"props":964,"children":965},{"style":141},[966],{"type":70,"value":105},{"type":65,"tag":117,"props":968,"children":969},{"style":193},[970],{"type":70,"value":971},"publish",{"type":65,"tag":117,"props":973,"children":974},{"style":213},[975],{"type":70,"value":201},{"type":65,"tag":117,"props":977,"children":978},{"style":141},[979],{"type":70,"value":155},{"type":65,"tag":117,"props":981,"children":982},{"style":147},[983],{"type":70,"value":943},{"type":65,"tag":117,"props":985,"children":986},{"style":141},[987],{"type":70,"value":155},{"type":65,"tag":117,"props":989,"children":990},{"style":141},[991],{"type":70,"value":340},{"type":65,"tag":117,"props":993,"children":994},{"style":141},[995],{"type":70,"value":579},{"type":65,"tag":117,"props":997,"children":998},{"style":213},[999],{"type":70,"value":1000}," user",{"type":65,"tag":117,"props":1002,"children":1003},{"style":141},[1004],{"type":70,"value":221},{"type":65,"tag":117,"props":1006,"children":1007},{"style":141},[1008],{"type":70,"value":144},{"type":65,"tag":117,"props":1010,"children":1011},{"style":147},[1012],{"type":70,"value":1013},"server",{"type":65,"tag":117,"props":1015,"children":1016},{"style":141},[1017],{"type":70,"value":155},{"type":65,"tag":117,"props":1019,"children":1020},{"style":141},[1021],{"type":70,"value":340},{"type":65,"tag":117,"props":1023,"children":1024},{"style":213},[1025],{"type":70,"value":1026}," message",{"type":65,"tag":117,"props":1028,"children":1029},{"style":141},[1030],{"type":70,"value":221},{"type":65,"tag":117,"props":1032,"children":1033},{"style":141},[1034],{"type":70,"value":1035}," `${",{"type":65,"tag":117,"props":1037,"children":1038},{"style":130},[1039],{"type":70,"value":905},{"type":65,"tag":117,"props":1041,"children":1042},{"style":141},[1043],{"type":70,"value":276},{"type":65,"tag":117,"props":1045,"children":1046},{"style":147},[1047],{"type":70,"value":1048}," joined!",{"type":65,"tag":117,"props":1050,"children":1051},{"style":141},[1052],{"type":70,"value":552},{"type":65,"tag":117,"props":1054,"children":1055},{"style":141},[1056],{"type":70,"value":614},{"type":65,"tag":117,"props":1058,"children":1059},{"style":213},[1060],{"type":70,"value":281},{"type":65,"tag":117,"props":1062,"children":1063},{"style":141},[1064],{"type":70,"value":160},{"type":65,"tag":117,"props":1066,"children":1067},{"class":119,"line":448},[1068],{"type":65,"tag":117,"props":1069,"children":1070},{"style":141},[1071],{"type":70,"value":1072},"    },\n",{"type":65,"tag":117,"props":1074,"children":1075},{"class":119,"line":503},[1076],{"type":65,"tag":117,"props":1077,"children":1078},{"style":141},[1079],{"type":70,"value":267},{"type":65,"tag":117,"props":1081,"children":1082},{"class":119,"line":512},[1083,1087,1091],{"type":65,"tag":117,"props":1084,"children":1085},{"style":141},[1086],{"type":70,"value":276},{"type":65,"tag":117,"props":1088,"children":1089},{"style":130},[1090],{"type":70,"value":281},{"type":65,"tag":117,"props":1092,"children":1093},{"style":141},[1094],{"type":70,"value":160},{"type":65,"tag":117,"props":1096,"children":1097},{"class":119,"line":536},[1098],{"type":65,"tag":117,"props":1099,"children":1100},{"emptyLinePlaceholder":167},[1101],{"type":70,"value":170},{"type":65,"tag":117,"props":1103,"children":1104},{"class":119,"line":559},[1105,1109,1113],{"type":65,"tag":117,"props":1106,"children":1107},{"style":124},[1108],{"type":70,"value":302},{"type":65,"tag":117,"props":1110,"children":1111},{"style":124},[1112],{"type":70,"value":307},{"type":65,"tag":117,"props":1114,"children":1115},{"style":141},[1116],{"type":70,"value":226},{"type":65,"tag":117,"props":1118,"children":1119},{"class":119,"line":622},[1120,1124,1128,1132,1136,1140,1144,1148,1152,1156],{"type":65,"tag":117,"props":1121,"children":1122},{"style":177},[1123],{"type":70,"value":320},{"type":65,"tag":117,"props":1125,"children":1126},{"style":213},[1127],{"type":70,"value":325},{"type":65,"tag":117,"props":1129,"children":1130},{"style":141},[1131],{"type":70,"value":201},{"type":65,"tag":117,"props":1133,"children":1134},{"style":332},[1135],{"type":70,"value":335},{"type":65,"tag":117,"props":1137,"children":1138},{"style":141},[1139],{"type":70,"value":340},{"type":65,"tag":117,"props":1141,"children":1142},{"style":332},[1143],{"type":70,"value":345},{"type":65,"tag":117,"props":1145,"children":1146},{"style":141},[1147],{"type":70,"value":340},{"type":65,"tag":117,"props":1149,"children":1150},{"style":332},[1151],{"type":70,"value":354},{"type":65,"tag":117,"props":1153,"children":1154},{"style":141},[1155],{"type":70,"value":281},{"type":65,"tag":117,"props":1157,"children":1158},{"style":141},[1159],{"type":70,"value":226},{"type":65,"tag":117,"props":1161,"children":1162},{"class":119,"line":635},[1163,1167,1171,1175,1179,1183,1187,1191,1195,1199,1203,1207,1211,1215,1219,1223,1227,1231],{"type":65,"tag":117,"props":1164,"children":1165},{"style":124},[1166],{"type":70,"value":371},{"type":65,"tag":117,"props":1168,"children":1169},{"style":213},[1170],{"type":70,"value":376},{"type":65,"tag":117,"props":1172,"children":1173},{"style":130},[1174],{"type":70,"value":335},{"type":65,"tag":117,"props":1176,"children":1177},{"style":141},[1178],{"type":70,"value":105},{"type":65,"tag":117,"props":1180,"children":1181},{"style":130},[1182],{"type":70,"value":389},{"type":65,"tag":117,"props":1184,"children":1185},{"style":141},[1186],{"type":70,"value":105},{"type":65,"tag":117,"props":1188,"children":1189},{"style":193},[1190],{"type":70,"value":398},{"type":65,"tag":117,"props":1192,"children":1193},{"style":213},[1194],{"type":70,"value":201},{"type":65,"tag":117,"props":1196,"children":1197},{"style":141},[1198],{"type":70,"value":155},{"type":65,"tag":117,"props":1200,"children":1201},{"style":147},[1202],{"type":70,"value":78},{"type":65,"tag":117,"props":1204,"children":1205},{"style":141},[1206],{"type":70,"value":155},{"type":65,"tag":117,"props":1208,"children":1209},{"style":213},[1210],{"type":70,"value":419},{"type":65,"tag":117,"props":1212,"children":1213},{"style":141},[1214],{"type":70,"value":424},{"type":65,"tag":117,"props":1216,"children":1217},{"style":141},[1218],{"type":70,"value":144},{"type":65,"tag":117,"props":1220,"children":1221},{"style":147},[1222],{"type":70,"value":433},{"type":65,"tag":117,"props":1224,"children":1225},{"style":141},[1226],{"type":70,"value":155},{"type":65,"tag":117,"props":1228,"children":1229},{"style":213},[1230],{"type":70,"value":419},{"type":65,"tag":117,"props":1232,"children":1233},{"style":141},[1234],{"type":70,"value":206},{"type":65,"tag":117,"props":1236,"children":1237},{"class":119,"line":643},[1238,1242,1246,1250,1254,1258,1262,1266,1270,1274,1278,1282],{"type":65,"tag":117,"props":1239,"children":1240},{"style":124},[1241],{"type":70,"value":454},{"type":65,"tag":117,"props":1243,"children":1244},{"style":130},[1245],{"type":70,"value":459},{"type":65,"tag":117,"props":1247,"children":1248},{"style":141},[1249],{"type":70,"value":105},{"type":65,"tag":117,"props":1251,"children":1252},{"style":193},[1253],{"type":70,"value":468},{"type":65,"tag":117,"props":1255,"children":1256},{"style":213},[1257],{"type":70,"value":201},{"type":65,"tag":117,"props":1259,"children":1260},{"style":130},[1261],{"type":70,"value":335},{"type":65,"tag":117,"props":1263,"children":1264},{"style":141},[1265],{"type":70,"value":340},{"type":65,"tag":117,"props":1267,"children":1268},{"style":130},[1269],{"type":70,"value":345},{"type":65,"tag":117,"props":1271,"children":1272},{"style":141},[1273],{"type":70,"value":340},{"type":65,"tag":117,"props":1275,"children":1276},{"style":130},[1277],{"type":70,"value":354},{"type":65,"tag":117,"props":1279,"children":1280},{"style":213},[1281],{"type":70,"value":281},{"type":65,"tag":117,"props":1283,"children":1284},{"style":141},[1285],{"type":70,"value":160},{"type":65,"tag":117,"props":1287,"children":1289},{"class":119,"line":1288},20,[1290],{"type":65,"tag":117,"props":1291,"children":1292},{"style":141},[1293],{"type":70,"value":509},{"type":65,"tag":117,"props":1295,"children":1297},{"class":119,"line":1296},21,[1298,1302,1306,1310],{"type":65,"tag":117,"props":1299,"children":1300},{"style":124},[1301],{"type":70,"value":518},{"type":65,"tag":117,"props":1303,"children":1304},{"style":141},[1305],{"type":70,"value":523},{"type":65,"tag":117,"props":1307,"children":1308},{"style":193},[1309],{"type":70,"value":528},{"type":65,"tag":117,"props":1311,"children":1312},{"style":213},[1313],{"type":70,"value":533},{"type":65,"tag":117,"props":1315,"children":1317},{"class":119,"line":1316},22,[1318,1322,1326,1330],{"type":65,"tag":117,"props":1319,"children":1320},{"style":141},[1321],{"type":70,"value":542},{"type":65,"tag":117,"props":1323,"children":1324},{"style":147},[1325],{"type":70,"value":547},{"type":65,"tag":117,"props":1327,"children":1328},{"style":141},[1329],{"type":70,"value":552},{"type":65,"tag":117,"props":1331,"children":1332},{"style":141},[1333],{"type":70,"value":258},{"type":65,"tag":117,"props":1335,"children":1337},{"class":119,"line":1336},23,[1338,1342,1346,1350,1354,1358,1362,1366,1370,1374,1378,1382,1386],{"type":65,"tag":117,"props":1339,"children":1340},{"style":141},[1341],{"type":70,"value":565},{"type":65,"tag":117,"props":1343,"children":1344},{"style":213},[1345],{"type":70,"value":570},{"type":65,"tag":117,"props":1347,"children":1348},{"style":141},[1349],{"type":70,"value":221},{"type":65,"tag":117,"props":1351,"children":1352},{"style":141},[1353],{"type":70,"value":579},{"type":65,"tag":117,"props":1355,"children":1356},{"style":141},[1357],{"type":70,"value":144},{"type":65,"tag":117,"props":1359,"children":1360},{"style":213},[1361],{"type":70,"value":588},{"type":65,"tag":117,"props":1363,"children":1364},{"style":141},[1365],{"type":70,"value":155},{"type":65,"tag":117,"props":1367,"children":1368},{"style":141},[1369],{"type":70,"value":221},{"type":65,"tag":117,"props":1371,"children":1372},{"style":141},[1373],{"type":70,"value":144},{"type":65,"tag":117,"props":1375,"children":1376},{"style":147},[1377],{"type":70,"value":605},{"type":65,"tag":117,"props":1379,"children":1380},{"style":141},[1381],{"type":70,"value":155},{"type":65,"tag":117,"props":1383,"children":1384},{"style":141},[1385],{"type":70,"value":614},{"type":65,"tag":117,"props":1387,"children":1388},{"style":141},[1389],{"type":70,"value":619},{"type":65,"tag":117,"props":1391,"children":1393},{"class":119,"line":1392},24,[1394,1398],{"type":65,"tag":117,"props":1395,"children":1396},{"style":213},[1397],{"type":70,"value":628},{"type":65,"tag":117,"props":1399,"children":1400},{"style":141},[1401],{"type":70,"value":160},{"type":65,"tag":117,"props":1403,"children":1405},{"class":119,"line":1404},25,[1406],{"type":65,"tag":117,"props":1407,"children":1408},{"style":141},[1409],{"type":70,"value":267},{"type":65,"tag":117,"props":1411,"children":1413},{"class":119,"line":1412},26,[1414],{"type":65,"tag":117,"props":1415,"children":1416},{"style":141},[1417],{"type":70,"value":649},{"type":65,"tag":117,"props":1419,"children":1421},{"class":119,"line":1420},27,[1422],{"type":65,"tag":117,"props":1423,"children":1424},{"emptyLinePlaceholder":167},[1425],{"type":70,"value":170},{"type":65,"tag":117,"props":1427,"children":1429},{"class":119,"line":1428},28,[1430,1434,1439,1445,1450,1454],{"type":65,"tag":117,"props":1431,"children":1432},{"style":124},[1433],{"type":70,"value":302},{"type":65,"tag":117,"props":1435,"children":1436},{"style":177},[1437],{"type":70,"value":1438}," class",{"type":65,"tag":117,"props":1440,"children":1442},{"style":1441},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[1443],{"type":70,"value":1444}," $DurableObject",{"type":65,"tag":117,"props":1446,"children":1447},{"style":177},[1448],{"type":70,"value":1449}," extends",{"type":65,"tag":117,"props":1451,"children":1452},{"style":1441},[1453],{"type":70,"value":737},{"type":65,"tag":117,"props":1455,"children":1456},{"style":141},[1457],{"type":70,"value":226},{"type":65,"tag":117,"props":1459,"children":1461},{"class":119,"line":1460},29,[1462,1467,1471,1476,1480,1484,1488],{"type":65,"tag":117,"props":1463,"children":1464},{"style":177},[1465],{"type":70,"value":1466},"  constructor",{"type":65,"tag":117,"props":1468,"children":1469},{"style":141},[1470],{"type":70,"value":201},{"type":65,"tag":117,"props":1472,"children":1473},{"style":332},[1474],{"type":70,"value":1475},"state",{"type":65,"tag":117,"props":1477,"children":1478},{"style":141},[1479],{"type":70,"value":340},{"type":65,"tag":117,"props":1481,"children":1482},{"style":332},[1483],{"type":70,"value":345},{"type":65,"tag":117,"props":1485,"children":1486},{"style":141},[1487],{"type":70,"value":281},{"type":65,"tag":117,"props":1489,"children":1490},{"style":141},[1491],{"type":70,"value":226},{"type":65,"tag":117,"props":1493,"children":1495},{"class":119,"line":1494},30,[1496,1501,1505,1509,1513,1517,1521],{"type":65,"tag":117,"props":1497,"children":1498},{"style":130},[1499],{"type":70,"value":1500},"    super",{"type":65,"tag":117,"props":1502,"children":1503},{"style":213},[1504],{"type":70,"value":201},{"type":65,"tag":117,"props":1506,"children":1507},{"style":130},[1508],{"type":70,"value":1475},{"type":65,"tag":117,"props":1510,"children":1511},{"style":141},[1512],{"type":70,"value":340},{"type":65,"tag":117,"props":1514,"children":1515},{"style":130},[1516],{"type":70,"value":345},{"type":65,"tag":117,"props":1518,"children":1519},{"style":213},[1520],{"type":70,"value":281},{"type":65,"tag":117,"props":1522,"children":1523},{"style":141},[1524],{"type":70,"value":160},{"type":65,"tag":117,"props":1526,"children":1528},{"class":119,"line":1527},31,[1529,1534,1538,1543,1547,1552,1557,1561,1565,1569],{"type":65,"tag":117,"props":1530,"children":1531},{"style":130},[1532],{"type":70,"value":1533},"    ws",{"type":65,"tag":117,"props":1535,"children":1536},{"style":141},[1537],{"type":70,"value":105},{"type":65,"tag":117,"props":1539,"children":1540},{"style":193},[1541],{"type":70,"value":1542},"handleDurableInit",{"type":65,"tag":117,"props":1544,"children":1545},{"style":213},[1546],{"type":70,"value":201},{"type":65,"tag":117,"props":1548,"children":1549},{"style":141},[1550],{"type":70,"value":1551},"this,",{"type":65,"tag":117,"props":1553,"children":1554},{"style":130},[1555],{"type":70,"value":1556}," state",{"type":65,"tag":117,"props":1558,"children":1559},{"style":141},[1560],{"type":70,"value":340},{"type":65,"tag":117,"props":1562,"children":1563},{"style":130},[1564],{"type":70,"value":345},{"type":65,"tag":117,"props":1566,"children":1567},{"style":213},[1568],{"type":70,"value":281},{"type":65,"tag":117,"props":1570,"children":1571},{"style":141},[1572],{"type":70,"value":160},{"type":65,"tag":117,"props":1574,"children":1576},{"class":119,"line":1575},32,[1577],{"type":65,"tag":117,"props":1578,"children":1579},{"style":141},[1580],{"type":70,"value":1581},"  }\n",{"type":65,"tag":117,"props":1583,"children":1585},{"class":119,"line":1584},33,[1586],{"type":65,"tag":117,"props":1587,"children":1588},{"emptyLinePlaceholder":167},[1589],{"type":70,"value":170},{"type":65,"tag":117,"props":1591,"children":1593},{"class":119,"line":1592},34,[1594,1599,1603,1607,1611],{"type":65,"tag":117,"props":1595,"children":1596},{"style":213},[1597],{"type":70,"value":1598},"  fetch",{"type":65,"tag":117,"props":1600,"children":1601},{"style":141},[1602],{"type":70,"value":201},{"type":65,"tag":117,"props":1604,"children":1605},{"style":332},[1606],{"type":70,"value":335},{"type":65,"tag":117,"props":1608,"children":1609},{"style":141},[1610],{"type":70,"value":281},{"type":65,"tag":117,"props":1612,"children":1613},{"style":141},[1614],{"type":70,"value":226},{"type":65,"tag":117,"props":1616,"children":1618},{"class":119,"line":1617},35,[1619,1623,1627,1631,1636,1640,1644,1649,1653],{"type":65,"tag":117,"props":1620,"children":1621},{"style":124},[1622],{"type":70,"value":518},{"type":65,"tag":117,"props":1624,"children":1625},{"style":130},[1626],{"type":70,"value":459},{"type":65,"tag":117,"props":1628,"children":1629},{"style":141},[1630],{"type":70,"value":105},{"type":65,"tag":117,"props":1632,"children":1633},{"style":193},[1634],{"type":70,"value":1635},"handleDurableUpgrade",{"type":65,"tag":117,"props":1637,"children":1638},{"style":213},[1639],{"type":70,"value":201},{"type":65,"tag":117,"props":1641,"children":1642},{"style":141},[1643],{"type":70,"value":1551},{"type":65,"tag":117,"props":1645,"children":1646},{"style":130},[1647],{"type":70,"value":1648}," request",{"type":65,"tag":117,"props":1650,"children":1651},{"style":213},[1652],{"type":70,"value":281},{"type":65,"tag":117,"props":1654,"children":1655},{"style":141},[1656],{"type":70,"value":160},{"type":65,"tag":117,"props":1658,"children":1660},{"class":119,"line":1659},36,[1661],{"type":65,"tag":117,"props":1662,"children":1663},{"style":141},[1664],{"type":70,"value":1581},{"type":65,"tag":117,"props":1666,"children":1668},{"class":119,"line":1667},37,[1669],{"type":65,"tag":117,"props":1670,"children":1671},{"emptyLinePlaceholder":167},[1672],{"type":70,"value":170},{"type":65,"tag":117,"props":1674,"children":1676},{"class":119,"line":1675},38,[1677,1682,1686,1691,1695,1699,1703],{"type":65,"tag":117,"props":1678,"children":1679},{"style":213},[1680],{"type":70,"value":1681},"  webSocketMessage",{"type":65,"tag":117,"props":1683,"children":1684},{"style":141},[1685],{"type":70,"value":201},{"type":65,"tag":117,"props":1687,"children":1688},{"style":332},[1689],{"type":70,"value":1690},"client",{"type":65,"tag":117,"props":1692,"children":1693},{"style":141},[1694],{"type":70,"value":340},{"type":65,"tag":117,"props":1696,"children":1697},{"style":332},[1698],{"type":70,"value":1026},{"type":65,"tag":117,"props":1700,"children":1701},{"style":141},[1702],{"type":70,"value":281},{"type":65,"tag":117,"props":1704,"children":1705},{"style":141},[1706],{"type":70,"value":226},{"type":65,"tag":117,"props":1708,"children":1710},{"class":119,"line":1709},39,[1711,1715,1719,1723,1728,1732,1736,1741,1745,1749,1753],{"type":65,"tag":117,"props":1712,"children":1713},{"style":124},[1714],{"type":70,"value":518},{"type":65,"tag":117,"props":1716,"children":1717},{"style":130},[1718],{"type":70,"value":459},{"type":65,"tag":117,"props":1720,"children":1721},{"style":141},[1722],{"type":70,"value":105},{"type":65,"tag":117,"props":1724,"children":1725},{"style":193},[1726],{"type":70,"value":1727},"handleDurableMessage",{"type":65,"tag":117,"props":1729,"children":1730},{"style":213},[1731],{"type":70,"value":201},{"type":65,"tag":117,"props":1733,"children":1734},{"style":141},[1735],{"type":70,"value":1551},{"type":65,"tag":117,"props":1737,"children":1738},{"style":130},[1739],{"type":70,"value":1740}," client",{"type":65,"tag":117,"props":1742,"children":1743},{"style":141},[1744],{"type":70,"value":340},{"type":65,"tag":117,"props":1746,"children":1747},{"style":130},[1748],{"type":70,"value":1026},{"type":65,"tag":117,"props":1750,"children":1751},{"style":213},[1752],{"type":70,"value":281},{"type":65,"tag":117,"props":1754,"children":1755},{"style":141},[1756],{"type":70,"value":160},{"type":65,"tag":117,"props":1758,"children":1760},{"class":119,"line":1759},40,[1761],{"type":65,"tag":117,"props":1762,"children":1763},{"style":141},[1764],{"type":70,"value":1581},{"type":65,"tag":117,"props":1766,"children":1768},{"class":119,"line":1767},41,[1769],{"type":65,"tag":117,"props":1770,"children":1771},{"emptyLinePlaceholder":167},[1772],{"type":70,"value":170},{"type":65,"tag":117,"props":1774,"children":1776},{"class":119,"line":1775},42,[1777,1782,1786,1790,1794,1799,1803,1808,1812,1817,1821],{"type":65,"tag":117,"props":1778,"children":1779},{"style":213},[1780],{"type":70,"value":1781},"  webSocketClose",{"type":65,"tag":117,"props":1783,"children":1784},{"style":141},[1785],{"type":70,"value":201},{"type":65,"tag":117,"props":1787,"children":1788},{"style":332},[1789],{"type":70,"value":1690},{"type":65,"tag":117,"props":1791,"children":1792},{"style":141},[1793],{"type":70,"value":340},{"type":65,"tag":117,"props":1795,"children":1796},{"style":332},[1797],{"type":70,"value":1798}," code",{"type":65,"tag":117,"props":1800,"children":1801},{"style":141},[1802],{"type":70,"value":340},{"type":65,"tag":117,"props":1804,"children":1805},{"style":332},[1806],{"type":70,"value":1807}," reason",{"type":65,"tag":117,"props":1809,"children":1810},{"style":141},[1811],{"type":70,"value":340},{"type":65,"tag":117,"props":1813,"children":1814},{"style":332},[1815],{"type":70,"value":1816}," wasClean",{"type":65,"tag":117,"props":1818,"children":1819},{"style":141},[1820],{"type":70,"value":281},{"type":65,"tag":117,"props":1822,"children":1823},{"style":141},[1824],{"type":70,"value":226},{"type":65,"tag":117,"props":1826,"children":1828},{"class":119,"line":1827},43,[1829,1833,1837,1841,1846,1850,1854,1858,1862,1866,1870,1874,1878,1882,1886],{"type":65,"tag":117,"props":1830,"children":1831},{"style":124},[1832],{"type":70,"value":518},{"type":65,"tag":117,"props":1834,"children":1835},{"style":130},[1836],{"type":70,"value":459},{"type":65,"tag":117,"props":1838,"children":1839},{"style":141},[1840],{"type":70,"value":105},{"type":65,"tag":117,"props":1842,"children":1843},{"style":193},[1844],{"type":70,"value":1845},"handleDurableClose",{"type":65,"tag":117,"props":1847,"children":1848},{"style":213},[1849],{"type":70,"value":201},{"type":65,"tag":117,"props":1851,"children":1852},{"style":141},[1853],{"type":70,"value":1551},{"type":65,"tag":117,"props":1855,"children":1856},{"style":130},[1857],{"type":70,"value":1740},{"type":65,"tag":117,"props":1859,"children":1860},{"style":141},[1861],{"type":70,"value":340},{"type":65,"tag":117,"props":1863,"children":1864},{"style":130},[1865],{"type":70,"value":1798},{"type":65,"tag":117,"props":1867,"children":1868},{"style":141},[1869],{"type":70,"value":340},{"type":65,"tag":117,"props":1871,"children":1872},{"style":130},[1873],{"type":70,"value":1807},{"type":65,"tag":117,"props":1875,"children":1876},{"style":141},[1877],{"type":70,"value":340},{"type":65,"tag":117,"props":1879,"children":1880},{"style":130},[1881],{"type":70,"value":1816},{"type":65,"tag":117,"props":1883,"children":1884},{"style":213},[1885],{"type":70,"value":281},{"type":65,"tag":117,"props":1887,"children":1888},{"style":141},[1889],{"type":70,"value":160},{"type":65,"tag":117,"props":1891,"children":1893},{"class":119,"line":1892},44,[1894],{"type":65,"tag":117,"props":1895,"children":1896},{"style":141},[1897],{"type":70,"value":1581},{"type":65,"tag":117,"props":1899,"children":1901},{"class":119,"line":1900},45,[1902],{"type":65,"tag":117,"props":1903,"children":1904},{"style":141},[1905],{"type":70,"value":1906},"}\n",{"type":65,"tag":66,"props":1908,"children":1909},{},[1910,1912,1918],{"type":70,"value":1911},"Update your ",{"type":65,"tag":73,"props":1913,"children":1915},{"className":1914},[],[1916],{"type":70,"value":1917},"wrangler.toml",{"type":70,"value":1919}," to specify Durable object:",{"type":65,"tag":107,"props":1921,"children":1925},{"className":1922,"code":1923,"language":1924,"meta":59,"style":59},"language-ini shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","[[durable_objects.bindings]]\nname = \"$DurableObject\"\nclass_name = \"$DurableObject\"\n\n[[migrations]]\ntag = \"v1\"\nnew_classes = [\"$DurableObject\"]\n","ini",[1926],{"type":65,"tag":73,"props":1927,"children":1928},{"__ignoreMap":59},[1929,1942,1969,1993,2000,2012,2037],{"type":65,"tag":117,"props":1930,"children":1931},{"class":119,"line":120},[1932,1937],{"type":65,"tag":117,"props":1933,"children":1934},{"style":141},[1935],{"type":70,"value":1936},"[[durable_objects.bindings]",{"type":65,"tag":117,"props":1938,"children":1939},{"style":130},[1940],{"type":70,"value":1941},"]\n",{"type":65,"tag":117,"props":1943,"children":1944},{"class":119,"line":163},[1945,1950,1955,1959,1964],{"type":65,"tag":117,"props":1946,"children":1947},{"style":213},[1948],{"type":70,"value":1949},"name",{"type":65,"tag":117,"props":1951,"children":1952},{"style":141},[1953],{"type":70,"value":1954}," =",{"type":65,"tag":117,"props":1956,"children":1957},{"style":141},[1958],{"type":70,"value":144},{"type":65,"tag":117,"props":1960,"children":1961},{"style":147},[1962],{"type":70,"value":1963},"$DurableObject",{"type":65,"tag":117,"props":1965,"children":1966},{"style":141},[1967],{"type":70,"value":1968},"\"\n",{"type":65,"tag":117,"props":1970,"children":1971},{"class":119,"line":173},[1972,1977,1981,1985,1989],{"type":65,"tag":117,"props":1973,"children":1974},{"style":213},[1975],{"type":70,"value":1976},"class_name",{"type":65,"tag":117,"props":1978,"children":1979},{"style":141},[1980],{"type":70,"value":1954},{"type":65,"tag":117,"props":1982,"children":1983},{"style":141},[1984],{"type":70,"value":144},{"type":65,"tag":117,"props":1986,"children":1987},{"style":147},[1988],{"type":70,"value":1963},{"type":65,"tag":117,"props":1990,"children":1991},{"style":141},[1992],{"type":70,"value":1968},{"type":65,"tag":117,"props":1994,"children":1995},{"class":119,"line":209},[1996],{"type":65,"tag":117,"props":1997,"children":1998},{"emptyLinePlaceholder":167},[1999],{"type":70,"value":170},{"type":65,"tag":117,"props":2001,"children":2002},{"class":119,"line":229},[2003,2008],{"type":65,"tag":117,"props":2004,"children":2005},{"style":141},[2006],{"type":70,"value":2007},"[[migrations]",{"type":65,"tag":117,"props":2009,"children":2010},{"style":130},[2011],{"type":70,"value":1941},{"type":65,"tag":117,"props":2013,"children":2014},{"class":119,"line":261},[2015,2020,2024,2028,2033],{"type":65,"tag":117,"props":2016,"children":2017},{"style":213},[2018],{"type":70,"value":2019},"tag",{"type":65,"tag":117,"props":2021,"children":2022},{"style":141},[2023],{"type":70,"value":1954},{"type":65,"tag":117,"props":2025,"children":2026},{"style":141},[2027],{"type":70,"value":144},{"type":65,"tag":117,"props":2029,"children":2030},{"style":147},[2031],{"type":70,"value":2032},"v1",{"type":65,"tag":117,"props":2034,"children":2035},{"style":141},[2036],{"type":70,"value":1968},{"type":65,"tag":117,"props":2038,"children":2039},{"class":119,"line":270},[2040,2045,2049,2054,2058,2062,2066],{"type":65,"tag":117,"props":2041,"children":2042},{"style":213},[2043],{"type":70,"value":2044},"new_classes",{"type":65,"tag":117,"props":2046,"children":2047},{"style":141},[2048],{"type":70,"value":1954},{"type":65,"tag":117,"props":2050,"children":2051},{"style":130},[2052],{"type":70,"value":2053}," [",{"type":65,"tag":117,"props":2055,"children":2056},{"style":141},[2057],{"type":70,"value":155},{"type":65,"tag":117,"props":2059,"children":2060},{"style":147},[2061],{"type":70,"value":1963},{"type":65,"tag":117,"props":2063,"children":2064},{"style":141},[2065],{"type":70,"value":155},{"type":65,"tag":117,"props":2067,"children":2068},{"style":130},[2069],{"type":70,"value":1941},{"type":65,"tag":651,"props":2071,"children":2072},{},[2073],{"type":65,"tag":66,"props":2074,"children":2075},{},[2076,2077,2088,2089,2100],{"type":70,"value":658},{"type":65,"tag":91,"props":2078,"children":2081},{"href":2079,"rel":2080},"https://github.com/h3js/crossws/blob/main/test/fixture/cloudflare-durable.ts",[663],[2082],{"type":65,"tag":73,"props":2083,"children":2085},{"className":2084},[],[2086],{"type":70,"value":2087},"test/fixture/cloudflare-durable.ts",{"type":70,"value":672},{"type":65,"tag":91,"props":2090,"children":2093},{"href":2091,"rel":2092},"https://github.com/h3js/crossws/blob/main/src/adapters/cloudflare-durable.ts",[663],[2094],{"type":65,"tag":73,"props":2095,"children":2097},{"className":2096},[],[2098],{"type":70,"value":2099},"src/adapters/cloudflare-durable.ts",{"type":70,"value":685},{"type":65,"tag":2102,"props":2103,"children":2105},"h3",{"id":2104},"adapter-options",[2106],{"type":70,"value":2107},"Adapter options",{"type":65,"tag":2109,"props":2110,"children":2111},"note",{},[2112],{"type":65,"tag":66,"props":2113,"children":2114},{},[2115,2117,2122,2124,2130,2132,2138,2140,2146],{"type":70,"value":2116},"\nBy default, crossws uses the durable object class ",{"type":65,"tag":73,"props":2118,"children":2120},{"className":2119},[],[2121],{"type":70,"value":1963},{"type":70,"value":2123}," from ",{"type":65,"tag":73,"props":2125,"children":2127},{"className":2126},[],[2128],{"type":70,"value":2129},"env",{"type":70,"value":2131}," with an instance named ",{"type":65,"tag":73,"props":2133,"children":2135},{"className":2134},[],[2136],{"type":70,"value":2137},"crossws",{"type":70,"value":2139},".\nYou can customize this behavior by providing ",{"type":65,"tag":73,"props":2141,"children":2143},{"className":2142},[],[2144],{"type":70,"value":2145},"resolveDurableStub",{"type":70,"value":2147}," option.",{"type":65,"tag":2149,"props":2150,"children":2151},"ul",{},[2152,2171,2188],{"type":65,"tag":2153,"props":2154,"children":2155},"li",{},[2156,2162,2164,2169],{"type":65,"tag":73,"props":2157,"children":2159},{"className":2158},[],[2160],{"type":70,"value":2161},"bindingName",{"type":70,"value":2163},": Durable Object binding name from environment (default: ",{"type":65,"tag":73,"props":2165,"children":2167},{"className":2166},[],[2168],{"type":70,"value":1963},{"type":70,"value":2170},").",{"type":65,"tag":2153,"props":2172,"children":2173},{},[2174,2180,2182,2187],{"type":65,"tag":73,"props":2175,"children":2177},{"className":2176},[],[2178],{"type":70,"value":2179},"instanceName",{"type":70,"value":2181},": Durable Object instance name (default: ",{"type":65,"tag":73,"props":2183,"children":2185},{"className":2184},[],[2186],{"type":70,"value":2137},{"type":70,"value":2170},{"type":65,"tag":2153,"props":2189,"children":2190},{},[2191,2196,2198,2203,2205,2210],{"type":65,"tag":73,"props":2192,"children":2194},{"className":2193},[],[2195],{"type":70,"value":2145},{"type":70,"value":2197},": Custom function that resolves Durable Object binding to handle the WebSocket upgrade. This option will override ",{"type":65,"tag":73,"props":2199,"children":2201},{"className":2200},[],[2202],{"type":70,"value":2161},{"type":70,"value":2204}," and ",{"type":65,"tag":73,"props":2206,"children":2208},{"className":2207},[],[2209],{"type":70,"value":2179},{"type":70,"value":105},{"type":65,"tag":2212,"props":2213,"children":2214},"style",{},[2215],{"type":70,"value":2216},"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":59,"searchDepth":163,"depth":163,"links":2218},[2219],{"id":689,"depth":163,"text":103,"children":2220},[2221],{"id":2104,"depth":173,"text":2107},"markdown","content:2.adapters:cloudflare.md","content","2.adapters/cloudflare.md","2.adapters/cloudflare","md",[2229,2231],{"_path":38,"title":37,"description":2230},"Integrate crossws with Bun.",{"_path":46,"title":45,"description":2232},"Integrate crossws with Deno.",1747776031385]