[{"data":1,"prerenderedAt":1294},["ShallowReactive",2],{"navigation":3,"-adapters-bunny":72,"-adapters-bunny-surround":1289},[4,36],{"title":5,"path":6,"stem":7,"children":8,"icon":10},"Getting Started","/guide","1.guide/1.index",[9,11,16,21,26,31],{"title":5,"path":6,"stem":7,"icon":10},"ph:book-open-duotone",{"title":12,"path":13,"stem":14,"icon":15},"Hooks","/guide/hooks","1.guide/2.hooks","material-symbols-light:data-object",{"title":17,"path":18,"stem":19,"icon":20},"Peer","/guide/peer","1.guide/3.peer","mynaui:api",{"title":22,"path":23,"stem":24,"icon":25},"Message","/guide/message","1.guide/4.message","solar:letter-line-duotone",{"title":27,"path":28,"stem":29,"icon":30},"Pub / Sub","/guide/pubsub","1.guide/5.pubsub","simple-icons:googlepubsub",{"title":32,"path":33,"stem":34,"icon":35},"Resolver API","/guide/resolver","1.guide/6.resolver","tabler:route",{"title":37,"path":38,"stem":39,"children":40,"icon":42},"Adapters","/adapters","2.adapters/1.index",[41,43,48,52,57,62,67],{"title":37,"path":38,"stem":39,"icon":42},"emojione-monotone:electric-plug",{"title":44,"path":45,"stem":46,"icon":47},"Bun","/adapters/bun","2.adapters/bun","simple-icons:bun",{"title":49,"path":50,"stem":51},"Bunny","/adapters/bunny","2.adapters/bunny",{"title":53,"path":54,"stem":55,"icon":56},"Cloudflare","/adapters/cloudflare","2.adapters/cloudflare","devicon-plain:cloudflareworkers",{"title":58,"path":59,"stem":60,"icon":61},"Deno","/adapters/deno","2.adapters/deno","teenyicons:deno-solid",{"title":63,"path":64,"stem":65,"icon":66},"Node.js","/adapters/node","2.adapters/node","akar-icons:node-fill",{"title":68,"path":69,"stem":70,"icon":71},"SSE","/adapters/sse","2.adapters/sse","clarity:two-way-arrows-line",{"id":73,"title":49,"body":74,"description":83,"extension":1284,"meta":1285,"navigation":1286,"path":50,"seo":1287,"stem":51,"__hash__":1288},"content/2.adapters/bunny.md",{"type":75,"value":76,"toc":1282},"minimark",[77,1278],[78,79,84],"pre",{"className":80,"code":81,"language":82,"meta":83,"style":83},"language-mdc shiki shiki-themes github-light github-dark github-dark","---\nicon: simple-icons:bunny\n---\n\n# Bunny\n\n> Manually integrate crossws with Bunny.net Edge Scripting.\n\n> [!TIP]\n> You can use `serve` function from `crossws/server/bunny` to **automatically** integrate crossws with Bunny.net!\n\n[Bunny.net Edge Scripting](https://docs.bunny.net/scripting/websockets) supports WebSockets to deliver low-latency, bidirectional communication between your applications and users across the globe.\n\n## Usage\n\nTo integrate crossws with Bunny.net Edge Scripting, you need to check for the `upgrade` header and then call `handleUpgrade` method from the adapter passing the incoming request object. The returned value is the server upgrade response.\n\n```ts\nimport * as BunnySDK from \"@bunny.net/edgescript-sdk\";\nimport crossws from \"crossws/adapters/bunny\";\n\nconst ws = crossws({\n  hooks: {\n    message: (peer, message) => {\n      console.log(\"Received:\", message.text());\n      peer.send(`Echo: ${message.text()}`);\n    },\n    open: (peer) => {\n      console.log(\"Client connected\");\n    },\n    close: (peer) => {\n      console.log(\"Client disconnected\");\n    },\n  },\n});\n\nBunnySDK.net.http.serve(async (request: Request) => {\n  if (request.headers.get(\"upgrade\") === \"websocket\") {\n    return ws.handleUpgrade(request);\n  }\n\n  return new Response(\n    `\u003Cscript>new WebSocket(\"wss://your-domain.b-cdn.net\").addEventListener(\"open\", (e) => e.target.send(\"Hello from client!\"));\u003C/script>`,\n    { headers: { \"content-type\": \"text/html\" } },\n  );\n});\n```\n\n## Protocol Negotiation\n\nYou can control WebSocket protocol negotiation through the `upgrade` hook by setting the `sec-websocket-protocol` header. This is useful for implementing authorization or selecting specific subprotocols based on the request:\n\n```ts\nconst ws = crossws({\n  hooks: {\n    upgrade(req) {\n      // Check for authorization token\n      const token = req.headers.get(\"authorization\");\n      if (!token) {\n        return new Response(\"Unauthorized\", { status: 401 });\n      }\n\n      // Negotiate protocol based on client request\n      const requestedProtocol = req.headers.get(\"sec-websocket-protocol\");\n      const supportedProtocols = [\"graphql-ws\", \"graphql-transport-ws\"];\n\n      const protocol = requestedProtocol\n        ?.split(\",\")\n        .map((p) => p.trim())\n        .find((p) => supportedProtocols.includes(p));\n\n      return {\n        headers: {\n          \"sec-websocket-protocol\": protocol || \"\",\n        },\n      };\n    },\n  },\n});\n```\n\n## Options\n\nThe Bunny adapter supports the following options:\n\n### `protocol`\n\nThe WebSocket subprotocol to use for the connection.\n\n> [!NOTE]\n> This can be overridden by setting the `sec-websocket-protocol` header in the `upgrade` hook for dynamic protocol negotiation.\n\n```ts\nconst ws = crossws({\n  protocol: \"graphql-ws\",\n});\n```\n\n### `idleTimeout`\n\nThe number of seconds to wait for a pong response before closing the connection. Defaults to `30`.\n\nIf the client does not respond within this timeout, the connection is deemed unhealthy and closed. If no data is transmitted from the client for 2 minutes, the connection will be closed regardless of this configuration.\n\n```ts\nconst ws = crossws({\n  idleTimeout: 60,\n});\n```\n\n::read-more\nSee [Bunny.net WebSocket Documentation](https://docs.bunny.net/scripting/websockets) for more details on the WebSocket API.\n::\n\n::read-more\nSee [`src/adapters/bunny.ts`](https://github.com/h3js/crossws/blob/main/src/adapters/bunny.ts) for implementation.\n::\n\n","mdc","",[85,86,87,96,110,115,122,129,134,140,145,158,184,189,208,213,219,224,242,247,253,278,293,298,317,323,351,375,405,411,427,441,446,462,476,481,487,493,498,530,558,573,579,584,599,608,625,631,636,642,647,653,658,675,680,685,698,703,716,723,746,760,784,790,795,801,822,846,851,864,881,909,934,939,947,953,970,976,982,987,992,997,1002,1007,1013,1018,1024,1029,1038,1043,1049,1054,1064,1080,1085,1090,1103,1113,1118,1123,1128,1136,1141,1153,1158,1164,1169,1174,1187,1198,1203,1208,1213,1222,1238,1244,1249,1256,1273],"code",{"__ignoreMap":83},[88,89,92],"span",{"class":90,"line":91},"line",1,[88,93,95],{"class":94},"slsVL","---\n",[88,97,99,103,106],{"class":90,"line":98},2,[88,100,102],{"class":101},"sByVh","icon",[88,104,105],{"class":94},": ",[88,107,109],{"class":108},"sfrk1","simple-icons:bunny\n",[88,111,113],{"class":90,"line":112},3,[88,114,95],{"class":94},[88,116,118],{"class":90,"line":117},4,[88,119,121],{"emptyLinePlaceholder":120},true,"\n",[88,123,125],{"class":90,"line":124},5,[88,126,128],{"class":127},"s1c8L","# Bunny\n",[88,130,132],{"class":90,"line":131},6,[88,133,121],{"emptyLinePlaceholder":120},[88,135,137],{"class":90,"line":136},7,[88,138,139],{"class":101},"> Manually integrate crossws with Bunny.net Edge Scripting.\n",[88,141,143],{"class":90,"line":142},8,[88,144,121],{"emptyLinePlaceholder":120},[88,146,148,151,155],{"class":90,"line":147},9,[88,149,150],{"class":101},"> [",[88,152,154],{"class":153},"sg6f7","!TIP",[88,156,157],{"class":101},"]\n",[88,159,161,164,168,171,174,177,181],{"class":90,"line":160},10,[88,162,163],{"class":101},"> You can use ",[88,165,167],{"class":166},"suiK_","`serve`",[88,169,170],{"class":101}," function from ",[88,172,173],{"class":166},"`crossws/server/bunny`",[88,175,176],{"class":101}," to ",[88,178,180],{"class":179},"sQELQ","**automatically**",[88,182,183],{"class":101}," integrate crossws with Bunny.net!\n",[88,185,187],{"class":90,"line":186},11,[88,188,121],{"emptyLinePlaceholder":120},[88,190,192,195,198,201,205],{"class":90,"line":191},12,[88,193,194],{"class":94},"[",[88,196,197],{"class":153},"Bunny.net Edge Scripting",[88,199,200],{"class":94},"](",[88,202,204],{"class":203},"sXueF","https://docs.bunny.net/scripting/websockets",[88,206,207],{"class":94},") supports WebSockets to deliver low-latency, bidirectional communication between your applications and users across the globe.\n",[88,209,211],{"class":90,"line":210},13,[88,212,121],{"emptyLinePlaceholder":120},[88,214,216],{"class":90,"line":215},14,[88,217,218],{"class":127},"## Usage\n",[88,220,222],{"class":90,"line":221},15,[88,223,121],{"emptyLinePlaceholder":120},[88,225,227,230,233,236,239],{"class":90,"line":226},16,[88,228,229],{"class":94},"To integrate crossws with Bunny.net Edge Scripting, you need to check for the ",[88,231,232],{"class":166},"`upgrade`",[88,234,235],{"class":94}," header and then call ",[88,237,238],{"class":166},"`handleUpgrade`",[88,240,241],{"class":94}," method from the adapter passing the incoming request object. The returned value is the server upgrade response.\n",[88,243,245],{"class":90,"line":244},17,[88,246,121],{"emptyLinePlaceholder":120},[88,248,250],{"class":90,"line":249},18,[88,251,252],{"class":94},"```ts\n",[88,254,256,260,263,266,269,272,275],{"class":90,"line":255},19,[88,257,259],{"class":258},"so5gQ","import",[88,261,262],{"class":166}," *",[88,264,265],{"class":258}," as",[88,267,268],{"class":94}," BunnySDK ",[88,270,271],{"class":258},"from",[88,273,274],{"class":108}," \"@bunny.net/edgescript-sdk\"",[88,276,277],{"class":94},";\n",[88,279,281,283,286,288,291],{"class":90,"line":280},20,[88,282,259],{"class":258},[88,284,285],{"class":94}," crossws ",[88,287,271],{"class":258},[88,289,290],{"class":108}," \"crossws/adapters/bunny\"",[88,292,277],{"class":94},[88,294,296],{"class":90,"line":295},21,[88,297,121],{"emptyLinePlaceholder":120},[88,299,301,304,307,310,314],{"class":90,"line":300},22,[88,302,303],{"class":258},"const",[88,305,306],{"class":166}," ws",[88,308,309],{"class":258}," =",[88,311,313],{"class":312},"shcOC"," crossws",[88,315,316],{"class":94},"({\n",[88,318,320],{"class":90,"line":319},23,[88,321,322],{"class":94},"  hooks: {\n",[88,324,326,329,332,336,339,342,345,348],{"class":90,"line":325},24,[88,327,328],{"class":312},"    message",[88,330,331],{"class":94},": (",[88,333,335],{"class":334},"sQHwn","peer",[88,337,338],{"class":94},", ",[88,340,341],{"class":334},"message",[88,343,344],{"class":94},") ",[88,346,347],{"class":258},"=>",[88,349,350],{"class":94}," {\n",[88,352,354,357,360,363,366,369,372],{"class":90,"line":353},25,[88,355,356],{"class":94},"      console.",[88,358,359],{"class":312},"log",[88,361,362],{"class":94},"(",[88,364,365],{"class":108},"\"Received:\"",[88,367,368],{"class":94},", message.",[88,370,371],{"class":312},"text",[88,373,374],{"class":94},"());\n",[88,376,378,381,384,386,389,391,394,396,399,402],{"class":90,"line":377},26,[88,379,380],{"class":94},"      peer.",[88,382,383],{"class":312},"send",[88,385,362],{"class":94},[88,387,388],{"class":108},"`Echo: ${",[88,390,341],{"class":94},[88,392,393],{"class":108},".",[88,395,371],{"class":312},[88,397,398],{"class":108},"()",[88,400,401],{"class":108},"}`",[88,403,404],{"class":94},");\n",[88,406,408],{"class":90,"line":407},27,[88,409,410],{"class":94},"    },\n",[88,412,414,417,419,421,423,425],{"class":90,"line":413},28,[88,415,416],{"class":312},"    open",[88,418,331],{"class":94},[88,420,335],{"class":334},[88,422,344],{"class":94},[88,424,347],{"class":258},[88,426,350],{"class":94},[88,428,430,432,434,436,439],{"class":90,"line":429},29,[88,431,356],{"class":94},[88,433,359],{"class":312},[88,435,362],{"class":94},[88,437,438],{"class":108},"\"Client connected\"",[88,440,404],{"class":94},[88,442,444],{"class":90,"line":443},30,[88,445,410],{"class":94},[88,447,449,452,454,456,458,460],{"class":90,"line":448},31,[88,450,451],{"class":312},"    close",[88,453,331],{"class":94},[88,455,335],{"class":334},[88,457,344],{"class":94},[88,459,347],{"class":258},[88,461,350],{"class":94},[88,463,465,467,469,471,474],{"class":90,"line":464},32,[88,466,356],{"class":94},[88,468,359],{"class":312},[88,470,362],{"class":94},[88,472,473],{"class":108},"\"Client disconnected\"",[88,475,404],{"class":94},[88,477,479],{"class":90,"line":478},33,[88,480,410],{"class":94},[88,482,484],{"class":90,"line":483},34,[88,485,486],{"class":94},"  },\n",[88,488,490],{"class":90,"line":489},35,[88,491,492],{"class":94},"});\n",[88,494,496],{"class":90,"line":495},36,[88,497,121],{"emptyLinePlaceholder":120},[88,499,501,504,507,509,512,515,518,521,524,526,528],{"class":90,"line":500},37,[88,502,503],{"class":94},"BunnySDK.net.http.",[88,505,506],{"class":312},"serve",[88,508,362],{"class":94},[88,510,511],{"class":258},"async",[88,513,514],{"class":94}," (",[88,516,517],{"class":334},"request",[88,519,520],{"class":258},":",[88,522,523],{"class":312}," Request",[88,525,344],{"class":94},[88,527,347],{"class":258},[88,529,350],{"class":94},[88,531,533,536,539,542,544,547,549,552,555],{"class":90,"line":532},38,[88,534,535],{"class":258},"  if",[88,537,538],{"class":94}," (request.headers.",[88,540,541],{"class":312},"get",[88,543,362],{"class":94},[88,545,546],{"class":108},"\"upgrade\"",[88,548,344],{"class":94},[88,550,551],{"class":258},"===",[88,553,554],{"class":108}," \"websocket\"",[88,556,557],{"class":94},") {\n",[88,559,561,564,567,570],{"class":90,"line":560},39,[88,562,563],{"class":258},"    return",[88,565,566],{"class":94}," ws.",[88,568,569],{"class":312},"handleUpgrade",[88,571,572],{"class":94},"(request);\n",[88,574,576],{"class":90,"line":575},40,[88,577,578],{"class":94},"  }\n",[88,580,582],{"class":90,"line":581},41,[88,583,121],{"emptyLinePlaceholder":120},[88,585,587,590,593,596],{"class":90,"line":586},42,[88,588,589],{"class":258},"  return",[88,591,592],{"class":258}," new",[88,594,595],{"class":312}," Response",[88,597,598],{"class":94},"(\n",[88,600,602,605],{"class":90,"line":601},43,[88,603,604],{"class":108},"    `\u003Cscript>new WebSocket(\"wss://your-domain.b-cdn.net\").addEventListener(\"open\", (e) => e.target.send(\"Hello from client!\"));\u003C/script>`",[88,606,607],{"class":94},",\n",[88,609,611,614,617,619,622],{"class":90,"line":610},44,[88,612,613],{"class":94},"    { headers: { ",[88,615,616],{"class":108},"\"content-type\"",[88,618,105],{"class":94},[88,620,621],{"class":108},"\"text/html\"",[88,623,624],{"class":94}," } },\n",[88,626,628],{"class":90,"line":627},45,[88,629,630],{"class":94},"  );\n",[88,632,634],{"class":90,"line":633},46,[88,635,492],{"class":94},[88,637,639],{"class":90,"line":638},47,[88,640,641],{"class":94},"```\n",[88,643,645],{"class":90,"line":644},48,[88,646,121],{"emptyLinePlaceholder":120},[88,648,650],{"class":90,"line":649},49,[88,651,652],{"class":127},"## Protocol Negotiation\n",[88,654,656],{"class":90,"line":655},50,[88,657,121],{"emptyLinePlaceholder":120},[88,659,661,664,666,669,672],{"class":90,"line":660},51,[88,662,663],{"class":94},"You can control WebSocket protocol negotiation through the ",[88,665,232],{"class":166},[88,667,668],{"class":94}," hook by setting the ",[88,670,671],{"class":166},"`sec-websocket-protocol`",[88,673,674],{"class":94}," header. This is useful for implementing authorization or selecting specific subprotocols based on the request:\n",[88,676,678],{"class":90,"line":677},52,[88,679,121],{"emptyLinePlaceholder":120},[88,681,683],{"class":90,"line":682},53,[88,684,252],{"class":94},[88,686,688,690,692,694,696],{"class":90,"line":687},54,[88,689,303],{"class":258},[88,691,306],{"class":166},[88,693,309],{"class":258},[88,695,313],{"class":312},[88,697,316],{"class":94},[88,699,701],{"class":90,"line":700},55,[88,702,322],{"class":94},[88,704,706,709,711,714],{"class":90,"line":705},56,[88,707,708],{"class":312},"    upgrade",[88,710,362],{"class":94},[88,712,713],{"class":334},"req",[88,715,557],{"class":94},[88,717,719],{"class":90,"line":718},57,[88,720,722],{"class":721},"sCsY4","      // Check for authorization token\n",[88,724,726,729,732,734,737,739,741,744],{"class":90,"line":725},58,[88,727,728],{"class":258},"      const",[88,730,731],{"class":166}," token",[88,733,309],{"class":258},[88,735,736],{"class":94}," req.headers.",[88,738,541],{"class":312},[88,740,362],{"class":94},[88,742,743],{"class":108},"\"authorization\"",[88,745,404],{"class":94},[88,747,749,752,754,757],{"class":90,"line":748},59,[88,750,751],{"class":258},"      if",[88,753,514],{"class":94},[88,755,756],{"class":258},"!",[88,758,759],{"class":94},"token) {\n",[88,761,763,766,768,770,772,775,778,781],{"class":90,"line":762},60,[88,764,765],{"class":258},"        return",[88,767,592],{"class":258},[88,769,595],{"class":312},[88,771,362],{"class":94},[88,773,774],{"class":108},"\"Unauthorized\"",[88,776,777],{"class":94},", { status: ",[88,779,780],{"class":166},"401",[88,782,783],{"class":94}," });\n",[88,785,787],{"class":90,"line":786},61,[88,788,789],{"class":94},"      }\n",[88,791,793],{"class":90,"line":792},62,[88,794,121],{"emptyLinePlaceholder":120},[88,796,798],{"class":90,"line":797},63,[88,799,800],{"class":721},"      // Negotiate protocol based on client request\n",[88,802,804,806,809,811,813,815,817,820],{"class":90,"line":803},64,[88,805,728],{"class":258},[88,807,808],{"class":166}," requestedProtocol",[88,810,309],{"class":258},[88,812,736],{"class":94},[88,814,541],{"class":312},[88,816,362],{"class":94},[88,818,819],{"class":108},"\"sec-websocket-protocol\"",[88,821,404],{"class":94},[88,823,825,827,830,832,835,838,840,843],{"class":90,"line":824},65,[88,826,728],{"class":258},[88,828,829],{"class":166}," supportedProtocols",[88,831,309],{"class":258},[88,833,834],{"class":94}," [",[88,836,837],{"class":108},"\"graphql-ws\"",[88,839,338],{"class":94},[88,841,842],{"class":108},"\"graphql-transport-ws\"",[88,844,845],{"class":94},"];\n",[88,847,849],{"class":90,"line":848},66,[88,850,121],{"emptyLinePlaceholder":120},[88,852,854,856,859,861],{"class":90,"line":853},67,[88,855,728],{"class":258},[88,857,858],{"class":166}," protocol",[88,860,309],{"class":258},[88,862,863],{"class":94}," requestedProtocol\n",[88,865,867,870,873,875,878],{"class":90,"line":866},68,[88,868,869],{"class":94},"        ?.",[88,871,872],{"class":312},"split",[88,874,362],{"class":94},[88,876,877],{"class":108},"\",\"",[88,879,880],{"class":94},")\n",[88,882,884,887,890,893,896,898,900,903,906],{"class":90,"line":883},69,[88,885,886],{"class":94},"        .",[88,888,889],{"class":312},"map",[88,891,892],{"class":94},"((",[88,894,895],{"class":334},"p",[88,897,344],{"class":94},[88,899,347],{"class":258},[88,901,902],{"class":94}," p.",[88,904,905],{"class":312},"trim",[88,907,908],{"class":94},"())\n",[88,910,912,914,917,919,921,923,925,928,931],{"class":90,"line":911},70,[88,913,886],{"class":94},[88,915,916],{"class":312},"find",[88,918,892],{"class":94},[88,920,895],{"class":334},[88,922,344],{"class":94},[88,924,347],{"class":258},[88,926,927],{"class":94}," supportedProtocols.",[88,929,930],{"class":312},"includes",[88,932,933],{"class":94},"(p));\n",[88,935,937],{"class":90,"line":936},71,[88,938,121],{"emptyLinePlaceholder":120},[88,940,942,945],{"class":90,"line":941},72,[88,943,944],{"class":258},"      return",[88,946,350],{"class":94},[88,948,950],{"class":90,"line":949},73,[88,951,952],{"class":94},"        headers: {\n",[88,954,956,959,962,965,968],{"class":90,"line":955},74,[88,957,958],{"class":108},"          \"sec-websocket-protocol\"",[88,960,961],{"class":94},": protocol ",[88,963,964],{"class":258},"||",[88,966,967],{"class":108}," \"\"",[88,969,607],{"class":94},[88,971,973],{"class":90,"line":972},75,[88,974,975],{"class":94},"        },\n",[88,977,979],{"class":90,"line":978},76,[88,980,981],{"class":94},"      };\n",[88,983,985],{"class":90,"line":984},77,[88,986,410],{"class":94},[88,988,990],{"class":90,"line":989},78,[88,991,486],{"class":94},[88,993,995],{"class":90,"line":994},79,[88,996,492],{"class":94},[88,998,1000],{"class":90,"line":999},80,[88,1001,641],{"class":94},[88,1003,1005],{"class":90,"line":1004},81,[88,1006,121],{"emptyLinePlaceholder":120},[88,1008,1010],{"class":90,"line":1009},82,[88,1011,1012],{"class":127},"## Options\n",[88,1014,1016],{"class":90,"line":1015},83,[88,1017,121],{"emptyLinePlaceholder":120},[88,1019,1021],{"class":90,"line":1020},84,[88,1022,1023],{"class":94},"The Bunny adapter supports the following options:\n",[88,1025,1027],{"class":90,"line":1026},85,[88,1028,121],{"emptyLinePlaceholder":120},[88,1030,1032,1035],{"class":90,"line":1031},86,[88,1033,1034],{"class":127},"### ",[88,1036,1037],{"class":127},"`protocol`\n",[88,1039,1041],{"class":90,"line":1040},87,[88,1042,121],{"emptyLinePlaceholder":120},[88,1044,1046],{"class":90,"line":1045},88,[88,1047,1048],{"class":94},"The WebSocket subprotocol to use for the connection.\n",[88,1050,1052],{"class":90,"line":1051},89,[88,1053,121],{"emptyLinePlaceholder":120},[88,1055,1057,1059,1062],{"class":90,"line":1056},90,[88,1058,150],{"class":101},[88,1060,1061],{"class":153},"!NOTE",[88,1063,157],{"class":101},[88,1065,1067,1070,1072,1075,1077],{"class":90,"line":1066},91,[88,1068,1069],{"class":101},"> This can be overridden by setting the ",[88,1071,671],{"class":166},[88,1073,1074],{"class":101}," header in the ",[88,1076,232],{"class":166},[88,1078,1079],{"class":101}," hook for dynamic protocol negotiation.\n",[88,1081,1083],{"class":90,"line":1082},92,[88,1084,121],{"emptyLinePlaceholder":120},[88,1086,1088],{"class":90,"line":1087},93,[88,1089,252],{"class":94},[88,1091,1093,1095,1097,1099,1101],{"class":90,"line":1092},94,[88,1094,303],{"class":258},[88,1096,306],{"class":166},[88,1098,309],{"class":258},[88,1100,313],{"class":312},[88,1102,316],{"class":94},[88,1104,1106,1109,1111],{"class":90,"line":1105},95,[88,1107,1108],{"class":94},"  protocol: ",[88,1110,837],{"class":108},[88,1112,607],{"class":94},[88,1114,1116],{"class":90,"line":1115},96,[88,1117,492],{"class":94},[88,1119,1121],{"class":90,"line":1120},97,[88,1122,641],{"class":94},[88,1124,1126],{"class":90,"line":1125},98,[88,1127,121],{"emptyLinePlaceholder":120},[88,1129,1131,1133],{"class":90,"line":1130},99,[88,1132,1034],{"class":127},[88,1134,1135],{"class":127},"`idleTimeout`\n",[88,1137,1139],{"class":90,"line":1138},100,[88,1140,121],{"emptyLinePlaceholder":120},[88,1142,1144,1147,1150],{"class":90,"line":1143},101,[88,1145,1146],{"class":94},"The number of seconds to wait for a pong response before closing the connection. Defaults to ",[88,1148,1149],{"class":166},"`30`",[88,1151,1152],{"class":94},".\n",[88,1154,1156],{"class":90,"line":1155},102,[88,1157,121],{"emptyLinePlaceholder":120},[88,1159,1161],{"class":90,"line":1160},103,[88,1162,1163],{"class":94},"If the client does not respond within this timeout, the connection is deemed unhealthy and closed. If no data is transmitted from the client for 2 minutes, the connection will be closed regardless of this configuration.\n",[88,1165,1167],{"class":90,"line":1166},104,[88,1168,121],{"emptyLinePlaceholder":120},[88,1170,1172],{"class":90,"line":1171},105,[88,1173,252],{"class":94},[88,1175,1177,1179,1181,1183,1185],{"class":90,"line":1176},106,[88,1178,303],{"class":258},[88,1180,306],{"class":166},[88,1182,309],{"class":258},[88,1184,313],{"class":312},[88,1186,316],{"class":94},[88,1188,1190,1193,1196],{"class":90,"line":1189},107,[88,1191,1192],{"class":94},"  idleTimeout: ",[88,1194,1195],{"class":166},"60",[88,1197,607],{"class":94},[88,1199,1201],{"class":90,"line":1200},108,[88,1202,492],{"class":94},[88,1204,1206],{"class":90,"line":1205},109,[88,1207,641],{"class":94},[88,1209,1211],{"class":90,"line":1210},110,[88,1212,121],{"emptyLinePlaceholder":120},[88,1214,1216,1219],{"class":90,"line":1215},111,[88,1217,1218],{"class":94},"::",[88,1220,1221],{"class":101},"read-more\n",[88,1223,1225,1228,1231,1233,1235],{"class":90,"line":1224},112,[88,1226,1227],{"class":94},"See [",[88,1229,1230],{"class":153},"Bunny.net WebSocket Documentation",[88,1232,200],{"class":94},[88,1234,204],{"class":203},[88,1236,1237],{"class":94},") for more details on the WebSocket API.\n",[88,1239,1241],{"class":90,"line":1240},113,[88,1242,1243],{"class":94},"::\n",[88,1245,1247],{"class":90,"line":1246},114,[88,1248,121],{"emptyLinePlaceholder":120},[88,1250,1252,1254],{"class":90,"line":1251},115,[88,1253,1218],{"class":94},[88,1255,1221],{"class":101},[88,1257,1259,1261,1265,1267,1270],{"class":90,"line":1258},116,[88,1260,1227],{"class":94},[88,1262,1264],{"class":1263},"sIaQW","`src/adapters/bunny.ts`",[88,1266,200],{"class":94},[88,1268,1269],{"class":203},"https://github.com/h3js/crossws/blob/main/src/adapters/bunny.ts",[88,1271,1272],{"class":94},") for implementation.\n",[88,1274,1276],{"class":90,"line":1275},117,[88,1277,1243],{"class":94},[1279,1280,1281],"style",{},"html pre.shiki code .slsVL, html code.shiki .slsVL{--shiki-light:#24292E;--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8}html pre.shiki code .sByVh, html code.shiki .sByVh{--shiki-light:#22863A;--shiki-default:#85E89D;--shiki-dark:#85E89D}html pre.shiki code .sfrk1, html code.shiki .sfrk1{--shiki-light:#032F62;--shiki-default:#9ECBFF;--shiki-dark:#9ECBFF}html pre.shiki code .s1c8L, html code.shiki .s1c8L{--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-default:#79B8FF;--shiki-default-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold}html pre.shiki code .sg6f7, html code.shiki .sg6f7{--shiki-light:#032F62;--shiki-light-text-decoration:underline;--shiki-default:#DBEDFF;--shiki-default-text-decoration:underline;--shiki-dark:#DBEDFF;--shiki-dark-text-decoration:underline}html pre.shiki code .suiK_, html code.shiki .suiK_{--shiki-light:#005CC5;--shiki-default:#79B8FF;--shiki-dark:#79B8FF}html pre.shiki code .sQELQ, html code.shiki .sQELQ{--shiki-light:#24292E;--shiki-light-font-weight:bold;--shiki-default:#E1E4E8;--shiki-default-font-weight:bold;--shiki-dark:#E1E4E8;--shiki-dark-font-weight:bold}html pre.shiki code .sXueF, html code.shiki .sXueF{--shiki-light:#24292E;--shiki-light-text-decoration:underline;--shiki-default:#E1E4E8;--shiki-default-text-decoration:underline;--shiki-dark:#E1E4E8;--shiki-dark-text-decoration:underline}html pre.shiki code .so5gQ, html code.shiki .so5gQ{--shiki-light:#D73A49;--shiki-default:#F97583;--shiki-dark:#F97583}html pre.shiki code .shcOC, html code.shiki .shcOC{--shiki-light:#6F42C1;--shiki-default:#B392F0;--shiki-dark:#B392F0}html pre.shiki code .sQHwn, html code.shiki .sQHwn{--shiki-light:#E36209;--shiki-default:#FFAB70;--shiki-dark:#FFAB70}html pre.shiki code .sCsY4, html code.shiki .sCsY4{--shiki-light:#6A737D;--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .sIaQW, html code.shiki .sIaQW{--shiki-light:#005CC5;--shiki-light-text-decoration:underline;--shiki-default:#79B8FF;--shiki-default-text-decoration:underline;--shiki-dark:#79B8FF;--shiki-dark-text-decoration:underline}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":83,"searchDepth":98,"depth":98,"links":1283},[],"md",{},{},{"title":49,"description":83},"FV-mn2JB8lPbeZnJbcxEfeGtbceP7IVzDaAM9lkq6Vs",[1290,1292],{"title":44,"path":45,"stem":46,"description":1291,"icon":47,"children":-1},"Manually integrate crossws with Bun.",{"title":53,"path":54,"stem":55,"description":1293,"icon":56,"children":-1},"Integrate crossws with Cloudflare Workers and Durable Objects.",1771506027188]