[{"data":1,"prerenderedAt":1751},["ShallowReactive",2],{"navigation":3,"/guide/peer":56,"/guide/peer-surround":1747},[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":16,"_dir":57,"_draft":58,"_partial":58,"_locale":59,"title":15,"description":60,"icon":17,"body":61,"_type":1741,"_id":1742,"_source":1743,"_file":1744,"_stem":1745,"_extension":1746},"guide",false,"","Peer object allows easily interacting with connected clients.",{"type":62,"children":63,"toc":1718},"root",[64,72,79,91,107,117,122,148,158,163,176,186,204,224,234,239,247,257,262,272,277,283,293,298,308,313,317,327,332,335,345,350,353,363,368,373,452,465,474,479,491,497,1290],{"type":65,"tag":66,"props":67,"children":68},"element","p",{},[69],{"type":70,"value":71},"text","When a new client connects to the server, crossws creates a peer instance that allows getting information from clients and sending messages to them.",{"type":65,"tag":73,"props":74,"children":76},"h2",{"id":75},"instance-properties",[77],{"type":70,"value":78},"Instance properties",{"type":65,"tag":80,"props":81,"children":83},"h3",{"id":82},"peerid",[84],{"type":65,"tag":85,"props":86,"children":88},"code",{"className":87},[],[89],{"type":70,"value":90},"peer.id",{"type":65,"tag":66,"props":92,"children":93},{},[94,96,105],{"type":70,"value":95},"Unique random identifier (",{"type":65,"tag":97,"props":98,"children":102},"a",{"href":99,"rel":100},"https://developer.mozilla.org/en-US/docs/Glossary/UUID",[101],"nofollow",[103],{"type":70,"value":104},"uuid v4",{"type":70,"value":106},") for the peer.",{"type":65,"tag":80,"props":108,"children":110},{"id":109},"peerrequest",[111],{"type":65,"tag":85,"props":112,"children":114},{"className":113},[],[115],{"type":70,"value":116},"peer.request?",{"type":65,"tag":66,"props":118,"children":119},{},[120],{"type":70,"value":121},"Access to the upgrade request info. You can use it to do authentication and access users headers and cookies.",{"type":65,"tag":123,"props":124,"children":125},"note",{},[126],{"type":65,"tag":66,"props":127,"children":128},{},[129,131,138,140,146],{"type":70,"value":130},"\nThis property is compatible with web ",{"type":65,"tag":97,"props":132,"children":135},{"href":133,"rel":134},"https://developer.mozilla.org/en-US/docs/Web/API/Request",[101],[136],{"type":70,"value":137},"Request",{"type":70,"value":139}," interface, However interface is emulated for Node.js and sometimes unavailable. Refer to the ",{"type":65,"tag":97,"props":141,"children":143},{"href":142},"#compatibility",[144],{"type":70,"value":145},"compatibility table",{"type":70,"value":147}," for more info.",{"type":65,"tag":80,"props":149,"children":151},{"id":150},"peerremoteaddress",[152],{"type":65,"tag":85,"props":153,"children":155},{"className":154},[],[156],{"type":70,"value":157},"peer.remoteAddress?",{"type":65,"tag":66,"props":159,"children":160},{},[161],{"type":70,"value":162},"The IP address of the client.",{"type":65,"tag":123,"props":164,"children":165},{},[166],{"type":65,"tag":66,"props":167,"children":168},{},[169,171,175],{"type":70,"value":170},"\nNot all adapters provide this. Refer to the ",{"type":65,"tag":97,"props":172,"children":173},{"href":142},[174],{"type":70,"value":145},{"type":70,"value":147},{"type":65,"tag":80,"props":177,"children":179},{"id":178},"peerwebsocket",[180],{"type":65,"tag":85,"props":181,"children":183},{"className":182},[],[184],{"type":70,"value":185},"peer.websocket",{"type":65,"tag":66,"props":187,"children":188},{},[189,191,202],{"type":70,"value":190},"Direct access to the ",{"type":65,"tag":97,"props":192,"children":195},{"href":193,"rel":194},"https://developer.mozilla.org/en-US/docs/Web/API/WebSocket",[101],[196],{"type":65,"tag":85,"props":197,"children":199},{"className":198},[],[200],{"type":70,"value":201},"WebSocket",{"type":70,"value":203}," instance.",{"type":65,"tag":123,"props":205,"children":206},{},[207],{"type":65,"tag":66,"props":208,"children":209},{},[210,212,217,219,223],{"type":70,"value":211},"\nWebSocket properties vary across runtimes. When accessing ",{"type":65,"tag":85,"props":213,"children":215},{"className":214},[],[216],{"type":70,"value":185},{"type":70,"value":218},", a lightweight proxy increases stability. Refer to the ",{"type":65,"tag":97,"props":220,"children":221},{"href":142},[222],{"type":70,"value":145},{"type":70,"value":147},{"type":65,"tag":80,"props":225,"children":227},{"id":226},"peercontext",[228],{"type":65,"tag":85,"props":229,"children":231},{"className":230},[],[232],{"type":70,"value":233},"peer.context",{"type":65,"tag":66,"props":235,"children":236},{},[237],{"type":70,"value":238},"The context is an object that contains arbitrary information about the request.",{"type":65,"tag":123,"props":240,"children":241},{},[242],{"type":65,"tag":66,"props":243,"children":244},{},[245],{"type":70,"value":246},"\ncontext data can be volatile in some runtimes.",{"type":65,"tag":80,"props":248,"children":250},{"id":249},"peertopics",[251],{"type":65,"tag":85,"props":252,"children":254},{"className":253},[],[255],{"type":70,"value":256},"peer.topics",{"type":65,"tag":66,"props":258,"children":259},{},[260],{"type":70,"value":261},"All topics, this peer has been subscribed to.",{"type":65,"tag":80,"props":263,"children":265},{"id":264},"peernamespace",[266],{"type":65,"tag":85,"props":267,"children":269},{"className":268},[],[270],{"type":70,"value":271},"peer.namespace",{"type":65,"tag":66,"props":273,"children":274},{},[275],{"type":70,"value":276},"Peer's pubsub namespace.",{"type":65,"tag":73,"props":278,"children":280},{"id":279},"instance-methods",[281],{"type":70,"value":282},"Instance methods",{"type":65,"tag":80,"props":284,"children":286},{"id":285},"peersendmessage-compress",[287],{"type":65,"tag":85,"props":288,"children":290},{"className":289},[],[291],{"type":70,"value":292},"peer.send(message, { compress? })",{"type":65,"tag":66,"props":294,"children":295},{},[296],{"type":70,"value":297},"Send a message to the connected client.",{"type":65,"tag":80,"props":299,"children":301},{"id":300},"peersubscribechannel",[302],{"type":65,"tag":85,"props":303,"children":305},{"className":304},[],[306],{"type":70,"value":307},"peer.subscribe(channel)",{"type":65,"tag":66,"props":309,"children":310},{},[311],{"type":70,"value":312},"Join a broadcast channel.",{"type":65,"tag":314,"props":315,"children":316},"read-more",{"to":24},[],{"type":65,"tag":80,"props":318,"children":320},{"id":319},"peerunsubscribechannel",[321],{"type":65,"tag":85,"props":322,"children":324},{"className":323},[],[325],{"type":70,"value":326},"peer.unsubscribe(channel)",{"type":65,"tag":66,"props":328,"children":329},{},[330],{"type":70,"value":331},"Leave a broadcast channel.",{"type":65,"tag":314,"props":333,"children":334},{"to":24},[],{"type":65,"tag":80,"props":336,"children":338},{"id":337},"peerpublishchannel-message",[339],{"type":65,"tag":85,"props":340,"children":342},{"className":341},[],[343],{"type":70,"value":344},"peer.publish(channel, message)",{"type":65,"tag":66,"props":346,"children":347},{},[348],{"type":70,"value":349},"broadcast a message to the channel.",{"type":65,"tag":314,"props":351,"children":352},{"to":24},[],{"type":65,"tag":80,"props":354,"children":356},{"id":355},"peerclosecode-number",[357],{"type":65,"tag":85,"props":358,"children":360},{"className":359},[],[361],{"type":70,"value":362},"peer.close(code?, number?)",{"type":65,"tag":66,"props":364,"children":365},{},[366],{"type":70,"value":367},"Gracefully closes the connection.",{"type":65,"tag":66,"props":369,"children":370},{},[371],{"type":70,"value":372},"Here is a list of close codes:",{"type":65,"tag":374,"props":375,"children":376},"ul",{},[377,389,400,411,422,433],{"type":65,"tag":378,"props":379,"children":380},"li",{},[381,387],{"type":65,"tag":85,"props":382,"children":384},{"className":383},[],[385],{"type":70,"value":386},"1000",{"type":70,"value":388}," means \"normal closure\" (default)",{"type":65,"tag":378,"props":390,"children":391},{},[392,398],{"type":65,"tag":85,"props":393,"children":395},{"className":394},[],[396],{"type":70,"value":397},"1009",{"type":70,"value":399}," means a message was too big and was rejected",{"type":65,"tag":378,"props":401,"children":402},{},[403,409],{"type":65,"tag":85,"props":404,"children":406},{"className":405},[],[407],{"type":70,"value":408},"1011",{"type":70,"value":410}," means the server encountered an error",{"type":65,"tag":378,"props":412,"children":413},{},[414,420],{"type":65,"tag":85,"props":415,"children":417},{"className":416},[],[418],{"type":70,"value":419},"1012",{"type":70,"value":421}," means the server is restarting",{"type":65,"tag":378,"props":423,"children":424},{},[425,431],{"type":65,"tag":85,"props":426,"children":428},{"className":427},[],[429],{"type":70,"value":430},"1013",{"type":70,"value":432}," means the server is too busy or the client is rate-limited",{"type":65,"tag":378,"props":434,"children":435},{},[436,442,444,450],{"type":65,"tag":85,"props":437,"children":439},{"className":438},[],[440],{"type":70,"value":441},"4000",{"type":70,"value":443}," through ",{"type":65,"tag":85,"props":445,"children":447},{"className":446},[],[448],{"type":70,"value":449},"4999",{"type":70,"value":451}," are reserved for applications (you can use it!)",{"type":65,"tag":66,"props":453,"children":454},{},[455,457,463],{"type":70,"value":456},"To close the connection abruptly, use ",{"type":65,"tag":85,"props":458,"children":460},{"className":459},[],[461],{"type":70,"value":462},"peer.terminate()",{"type":70,"value":464},".",{"type":65,"tag":80,"props":466,"children":468},{"id":467},"peerterminate",[469],{"type":65,"tag":85,"props":470,"children":472},{"className":471},[],[473],{"type":70,"value":462},{"type":65,"tag":66,"props":475,"children":476},{},[477],{"type":70,"value":478},"Abruptly close the connection.",{"type":65,"tag":66,"props":480,"children":481},{},[482,484,490],{"type":70,"value":483},"To gracefully close the connection, use ",{"type":65,"tag":85,"props":485,"children":487},{"className":486},[],[488],{"type":70,"value":489},"peer.close()",{"type":70,"value":464},{"type":65,"tag":73,"props":492,"children":494},{"id":493},"compatibility",[495],{"type":70,"value":496},"Compatibility",{"type":65,"tag":498,"props":499,"children":500},"table",{},[501,568],{"type":65,"tag":502,"props":503,"children":504},"thead",{},[505],{"type":65,"tag":506,"props":507,"children":508},"tr",{},[509,513,520,527,536,543,551,560],{"type":65,"tag":510,"props":511,"children":512},"th",{},[],{"type":65,"tag":510,"props":514,"children":515},{},[516],{"type":65,"tag":97,"props":517,"children":518},{"href":38},[519],{"type":70,"value":37},{"type":65,"tag":510,"props":521,"children":522},{},[523],{"type":65,"tag":97,"props":524,"children":525},{"href":42},[526],{"type":70,"value":41},{"type":65,"tag":510,"props":528,"children":529},{},[530],{"type":65,"tag":97,"props":531,"children":533},{"href":532},"/adapters/cloudflare#durable-objects",[534],{"type":70,"value":535},"Cloudflare (durable)",{"type":65,"tag":510,"props":537,"children":538},{},[539],{"type":65,"tag":97,"props":540,"children":541},{"href":46},[542],{"type":70,"value":45},{"type":65,"tag":510,"props":544,"children":545},{},[546],{"type":65,"tag":97,"props":547,"children":548},{"href":50},[549],{"type":70,"value":550},"Node (ws)",{"type":65,"tag":510,"props":552,"children":553},{},[554],{"type":65,"tag":97,"props":555,"children":557},{"href":556},"/adapters/node#uwebsockets",[558],{"type":70,"value":559},"Node (μWebSockets)",{"type":65,"tag":510,"props":561,"children":562},{},[563],{"type":65,"tag":97,"props":564,"children":566},{"href":565},"adapters/sse",[567],{"type":70,"value":53},{"type":65,"tag":569,"props":570,"children":571},"tbody",{},[572,614,704,744,804,875,915,955,1033,1130,1190,1250],{"type":65,"tag":506,"props":573,"children":574},{},[575,585,590,594,598,602,606,610],{"type":65,"tag":576,"props":577,"children":578},"td",{},[579],{"type":65,"tag":85,"props":580,"children":582},{"className":581},[],[583],{"type":70,"value":584},"send()",{"type":65,"tag":576,"props":586,"children":587},{},[588],{"type":70,"value":589},"✓",{"type":65,"tag":576,"props":591,"children":592},{},[593],{"type":70,"value":589},{"type":65,"tag":576,"props":595,"children":596},{},[597],{"type":70,"value":589},{"type":65,"tag":576,"props":599,"children":600},{},[601],{"type":70,"value":589},{"type":65,"tag":576,"props":603,"children":604},{},[605],{"type":70,"value":589},{"type":65,"tag":576,"props":607,"children":608},{},[609],{"type":70,"value":589},{"type":65,"tag":576,"props":611,"children":612},{},[613],{"type":70,"value":589},{"type":65,"tag":506,"props":615,"children":616},{},[617,634,638,643,661,674,687,691],{"type":65,"tag":576,"props":618,"children":619},{},[620,626,628],{"type":65,"tag":85,"props":621,"children":623},{"className":622},[],[624],{"type":70,"value":625},"publish()",{"type":70,"value":627}," / ",{"type":65,"tag":85,"props":629,"children":631},{"className":630},[],[632],{"type":70,"value":633},"subscribe()",{"type":65,"tag":576,"props":635,"children":636},{},[637],{"type":70,"value":589},{"type":65,"tag":576,"props":639,"children":640},{},[641],{"type":70,"value":642},"⨉",{"type":65,"tag":576,"props":644,"children":645},{},[646,648],{"type":70,"value":647},"✓ ",{"type":65,"tag":649,"props":650,"children":651},"sup",{},[652],{"type":65,"tag":97,"props":653,"children":658},{"href":654,"ariaDescribedBy":655,"dataFootnoteRef":59,"id":657},"#user-content-fn-1",[656],"footnote-label","user-content-fnref-1",[659],{"type":70,"value":660},"1",{"type":65,"tag":576,"props":662,"children":663},{},[664,665],{"type":70,"value":647},{"type":65,"tag":649,"props":666,"children":667},{},[668],{"type":65,"tag":97,"props":669,"children":672},{"href":654,"ariaDescribedBy":670,"dataFootnoteRef":59,"id":671},[656],"user-content-fnref-1-2",[673],{"type":70,"value":660},{"type":65,"tag":576,"props":675,"children":676},{},[677,678],{"type":70,"value":647},{"type":65,"tag":649,"props":679,"children":680},{},[681],{"type":65,"tag":97,"props":682,"children":685},{"href":654,"ariaDescribedBy":683,"dataFootnoteRef":59,"id":684},[656],"user-content-fnref-1-3",[686],{"type":70,"value":660},{"type":65,"tag":576,"props":688,"children":689},{},[690],{"type":70,"value":589},{"type":65,"tag":576,"props":692,"children":693},{},[694,695],{"type":70,"value":647},{"type":65,"tag":649,"props":696,"children":697},{},[698],{"type":65,"tag":97,"props":699,"children":702},{"href":654,"ariaDescribedBy":700,"dataFootnoteRef":59,"id":701},[656],"user-content-fnref-1-4",[703],{"type":70,"value":660},{"type":65,"tag":506,"props":705,"children":706},{},[707,716,720,724,728,732,736,740],{"type":65,"tag":576,"props":708,"children":709},{},[710],{"type":65,"tag":85,"props":711,"children":713},{"className":712},[],[714],{"type":70,"value":715},"close()",{"type":65,"tag":576,"props":717,"children":718},{},[719],{"type":70,"value":589},{"type":65,"tag":576,"props":721,"children":722},{},[723],{"type":70,"value":589},{"type":65,"tag":576,"props":725,"children":726},{},[727],{"type":70,"value":589},{"type":65,"tag":576,"props":729,"children":730},{},[731],{"type":70,"value":589},{"type":65,"tag":576,"props":733,"children":734},{},[735],{"type":70,"value":589},{"type":65,"tag":576,"props":737,"children":738},{},[739],{"type":70,"value":589},{"type":65,"tag":576,"props":741,"children":742},{},[743],{"type":70,"value":589},{"type":65,"tag":506,"props":745,"children":746},{},[747,756,760,775,779,783,787,791],{"type":65,"tag":576,"props":748,"children":749},{},[750],{"type":65,"tag":85,"props":751,"children":753},{"className":752},[],[754],{"type":70,"value":755},"terminate()",{"type":65,"tag":576,"props":757,"children":758},{},[759],{"type":70,"value":589},{"type":65,"tag":576,"props":761,"children":762},{},[763,764],{"type":70,"value":647},{"type":65,"tag":649,"props":765,"children":766},{},[767],{"type":65,"tag":97,"props":768,"children":772},{"href":769,"ariaDescribedBy":770,"dataFootnoteRef":59,"id":771},"#user-content-fn-2",[656],"user-content-fnref-2",[773],{"type":70,"value":774},"2",{"type":65,"tag":576,"props":776,"children":777},{},[778],{"type":70,"value":589},{"type":65,"tag":576,"props":780,"children":781},{},[782],{"type":70,"value":589},{"type":65,"tag":576,"props":784,"children":785},{},[786],{"type":70,"value":589},{"type":65,"tag":576,"props":788,"children":789},{},[790],{"type":70,"value":589},{"type":65,"tag":576,"props":792,"children":793},{},[794,795],{"type":70,"value":647},{"type":65,"tag":649,"props":796,"children":797},{},[798],{"type":65,"tag":97,"props":799,"children":802},{"href":769,"ariaDescribedBy":800,"dataFootnoteRef":59,"id":801},[656],"user-content-fnref-2-2",[803],{"type":70,"value":774},{"type":65,"tag":506,"props":805,"children":806},{},[807,816,820,824,839,843,858,871],{"type":65,"tag":576,"props":808,"children":809},{},[810],{"type":65,"tag":85,"props":811,"children":813},{"className":812},[],[814],{"type":70,"value":815},"request",{"type":65,"tag":576,"props":817,"children":818},{},[819],{"type":70,"value":589},{"type":65,"tag":576,"props":821,"children":822},{},[823],{"type":70,"value":589},{"type":65,"tag":576,"props":825,"children":826},{},[827,828],{"type":70,"value":647},{"type":65,"tag":649,"props":829,"children":830},{},[831],{"type":65,"tag":97,"props":832,"children":836},{"href":833,"ariaDescribedBy":834,"dataFootnoteRef":59,"id":835},"#user-content-fn-30",[656],"user-content-fnref-30",[837],{"type":70,"value":838},"3",{"type":65,"tag":576,"props":840,"children":841},{},[842],{"type":70,"value":589},{"type":65,"tag":576,"props":844,"children":845},{},[846,847],{"type":70,"value":647},{"type":65,"tag":649,"props":848,"children":849},{},[850],{"type":65,"tag":97,"props":851,"children":855},{"href":852,"ariaDescribedBy":853,"dataFootnoteRef":59,"id":854},"#user-content-fn-31",[656],"user-content-fnref-31",[856],{"type":70,"value":857},"4",{"type":65,"tag":576,"props":859,"children":860},{},[861,862],{"type":70,"value":647},{"type":65,"tag":649,"props":863,"children":864},{},[865],{"type":65,"tag":97,"props":866,"children":869},{"href":852,"ariaDescribedBy":867,"dataFootnoteRef":59,"id":868},[656],"user-content-fnref-31-2",[870],{"type":70,"value":857},{"type":65,"tag":576,"props":872,"children":873},{},[874],{"type":70,"value":589},{"type":65,"tag":506,"props":876,"children":877},{},[878,887,891,895,899,903,907,911],{"type":65,"tag":576,"props":879,"children":880},{},[881],{"type":65,"tag":85,"props":882,"children":884},{"className":883},[],[885],{"type":70,"value":886},"remoteAddress",{"type":65,"tag":576,"props":888,"children":889},{},[890],{"type":70,"value":589},{"type":65,"tag":576,"props":892,"children":893},{},[894],{"type":70,"value":642},{"type":65,"tag":576,"props":896,"children":897},{},[898],{"type":70,"value":642},{"type":65,"tag":576,"props":900,"children":901},{},[902],{"type":70,"value":589},{"type":65,"tag":576,"props":904,"children":905},{},[906],{"type":70,"value":589},{"type":65,"tag":576,"props":908,"children":909},{},[910],{"type":70,"value":589},{"type":65,"tag":576,"props":912,"children":913},{},[914],{"type":70,"value":642},{"type":65,"tag":506,"props":916,"children":917},{},[918,927,931,935,939,943,947,951],{"type":65,"tag":576,"props":919,"children":920},{},[921],{"type":65,"tag":85,"props":922,"children":924},{"className":923},[],[925],{"type":70,"value":926},"websocket.url",{"type":65,"tag":576,"props":928,"children":929},{},[930],{"type":70,"value":589},{"type":65,"tag":576,"props":932,"children":933},{},[934],{"type":70,"value":589},{"type":65,"tag":576,"props":936,"children":937},{},[938],{"type":70,"value":589},{"type":65,"tag":576,"props":940,"children":941},{},[942],{"type":70,"value":589},{"type":65,"tag":576,"props":944,"children":945},{},[946],{"type":70,"value":589},{"type":65,"tag":576,"props":948,"children":949},{},[950],{"type":70,"value":589},{"type":65,"tag":576,"props":952,"children":953},{},[954],{"type":70,"value":589},{"type":65,"tag":506,"props":956,"children":957},{},[958,967,982,986,990,1003,1016,1029],{"type":65,"tag":576,"props":959,"children":960},{},[961],{"type":65,"tag":85,"props":962,"children":964},{"className":963},[],[965],{"type":70,"value":966},"websocket.extensions",{"type":65,"tag":576,"props":968,"children":969},{},[970,971],{"type":70,"value":647},{"type":65,"tag":649,"props":972,"children":973},{},[974],{"type":65,"tag":97,"props":975,"children":979},{"href":976,"ariaDescribedBy":977,"dataFootnoteRef":59,"id":978},"#user-content-fn-4",[656],"user-content-fnref-4",[980],{"type":70,"value":981},"5",{"type":65,"tag":576,"props":983,"children":984},{},[985],{"type":70,"value":642},{"type":65,"tag":576,"props":987,"children":988},{},[989],{"type":70,"value":642},{"type":65,"tag":576,"props":991,"children":992},{},[993,994],{"type":70,"value":647},{"type":65,"tag":649,"props":995,"children":996},{},[997],{"type":65,"tag":97,"props":998,"children":1001},{"href":976,"ariaDescribedBy":999,"dataFootnoteRef":59,"id":1000},[656],"user-content-fnref-4-2",[1002],{"type":70,"value":981},{"type":65,"tag":576,"props":1004,"children":1005},{},[1006,1007],{"type":70,"value":647},{"type":65,"tag":649,"props":1008,"children":1009},{},[1010],{"type":65,"tag":97,"props":1011,"children":1014},{"href":976,"ariaDescribedBy":1012,"dataFootnoteRef":59,"id":1013},[656],"user-content-fnref-4-3",[1015],{"type":70,"value":981},{"type":65,"tag":576,"props":1017,"children":1018},{},[1019,1020],{"type":70,"value":647},{"type":65,"tag":649,"props":1021,"children":1022},{},[1023],{"type":65,"tag":97,"props":1024,"children":1027},{"href":976,"ariaDescribedBy":1025,"dataFootnoteRef":59,"id":1026},[656],"user-content-fnref-4-4",[1028],{"type":70,"value":981},{"type":65,"tag":576,"props":1030,"children":1031},{},[1032],{"type":70,"value":642},{"type":65,"tag":506,"props":1034,"children":1035},{},[1036,1045,1060,1073,1086,1100,1113,1126],{"type":65,"tag":576,"props":1037,"children":1038},{},[1039],{"type":65,"tag":85,"props":1040,"children":1042},{"className":1041},[],[1043],{"type":70,"value":1044},"websocket.protocol",{"type":65,"tag":576,"props":1046,"children":1047},{},[1048,1049],{"type":70,"value":647},{"type":65,"tag":649,"props":1050,"children":1051},{},[1052],{"type":65,"tag":97,"props":1053,"children":1057},{"href":1054,"ariaDescribedBy":1055,"dataFootnoteRef":59,"id":1056},"#user-content-fn-5",[656],"user-content-fnref-5",[1058],{"type":70,"value":1059},"6",{"type":65,"tag":576,"props":1061,"children":1062},{},[1063,1064],{"type":70,"value":647},{"type":65,"tag":649,"props":1065,"children":1066},{},[1067],{"type":65,"tag":97,"props":1068,"children":1071},{"href":1054,"ariaDescribedBy":1069,"dataFootnoteRef":59,"id":1070},[656],"user-content-fnref-5-2",[1072],{"type":70,"value":1059},{"type":65,"tag":576,"props":1074,"children":1075},{},[1076,1077],{"type":70,"value":647},{"type":65,"tag":649,"props":1078,"children":1079},{},[1080],{"type":65,"tag":97,"props":1081,"children":1084},{"href":1054,"ariaDescribedBy":1082,"dataFootnoteRef":59,"id":1083},[656],"user-content-fnref-5-3",[1085],{"type":70,"value":1059},{"type":65,"tag":576,"props":1087,"children":1088},{},[1089,1098],{"type":65,"tag":649,"props":1090,"children":1091},{},[1092],{"type":65,"tag":97,"props":1093,"children":1096},{"href":1054,"ariaDescribedBy":1094,"dataFootnoteRef":59,"id":1095},[656],"user-content-fnref-5-4",[1097],{"type":70,"value":1059},{"type":70,"value":1099}," ✓",{"type":65,"tag":576,"props":1101,"children":1102},{},[1103,1104],{"type":70,"value":647},{"type":65,"tag":649,"props":1105,"children":1106},{},[1107],{"type":65,"tag":97,"props":1108,"children":1111},{"href":1054,"ariaDescribedBy":1109,"dataFootnoteRef":59,"id":1110},[656],"user-content-fnref-5-5",[1112],{"type":70,"value":1059},{"type":65,"tag":576,"props":1114,"children":1115},{},[1116,1117],{"type":70,"value":647},{"type":65,"tag":649,"props":1118,"children":1119},{},[1120],{"type":65,"tag":97,"props":1121,"children":1124},{"href":1054,"ariaDescribedBy":1122,"dataFootnoteRef":59,"id":1123},[656],"user-content-fnref-5-6",[1125],{"type":70,"value":1059},{"type":65,"tag":576,"props":1127,"children":1128},{},[1129],{"type":70,"value":642},{"type":65,"tag":506,"props":1131,"children":1132},{},[1133,1142,1146,1150,1154,1158,1162,1177],{"type":65,"tag":576,"props":1134,"children":1135},{},[1136],{"type":65,"tag":85,"props":1137,"children":1139},{"className":1138},[],[1140],{"type":70,"value":1141},"websocket.readyState",{"type":65,"tag":576,"props":1143,"children":1144},{},[1145],{"type":70,"value":589},{"type":65,"tag":576,"props":1147,"children":1148},{},[1149],{"type":70,"value":589},{"type":65,"tag":576,"props":1151,"children":1152},{},[1153],{"type":70,"value":589},{"type":65,"tag":576,"props":1155,"children":1156},{},[1157],{"type":70,"value":589},{"type":65,"tag":576,"props":1159,"children":1160},{},[1161],{"type":70,"value":589},{"type":65,"tag":576,"props":1163,"children":1164},{},[1165,1166],{"type":70,"value":647},{"type":65,"tag":649,"props":1167,"children":1168},{},[1169],{"type":65,"tag":97,"props":1170,"children":1174},{"href":1171,"ariaDescribedBy":1172,"dataFootnoteRef":59,"id":1173},"#user-content-fn-6",[656],"user-content-fnref-6",[1175],{"type":70,"value":1176},"7",{"type":65,"tag":576,"props":1178,"children":1179},{},[1180,1181],{"type":70,"value":647},{"type":65,"tag":649,"props":1182,"children":1183},{},[1184],{"type":65,"tag":97,"props":1185,"children":1188},{"href":1171,"ariaDescribedBy":1186,"dataFootnoteRef":59,"id":1187},[656],"user-content-fnref-6-2",[1189],{"type":70,"value":1176},{"type":65,"tag":506,"props":1191,"children":1192},{},[1193,1202,1217,1221,1225,1229,1242,1246],{"type":65,"tag":576,"props":1194,"children":1195},{},[1196],{"type":65,"tag":85,"props":1197,"children":1199},{"className":1198},[],[1200],{"type":70,"value":1201},"websocket.binaryType",{"type":65,"tag":576,"props":1203,"children":1204},{},[1205,1206],{"type":70,"value":647},{"type":65,"tag":649,"props":1207,"children":1208},{},[1209],{"type":65,"tag":97,"props":1210,"children":1214},{"href":1211,"ariaDescribedBy":1212,"dataFootnoteRef":59,"id":1213},"#user-content-fn-7",[656],"user-content-fnref-7",[1215],{"type":70,"value":1216},"8",{"type":65,"tag":576,"props":1218,"children":1219},{},[1220],{"type":70,"value":642},{"type":65,"tag":576,"props":1222,"children":1223},{},[1224],{"type":70,"value":642},{"type":65,"tag":576,"props":1226,"children":1227},{},[1228],{"type":70,"value":589},{"type":65,"tag":576,"props":1230,"children":1231},{},[1232,1233],{"type":70,"value":647},{"type":65,"tag":649,"props":1234,"children":1235},{},[1236],{"type":65,"tag":97,"props":1237,"children":1240},{"href":1211,"ariaDescribedBy":1238,"dataFootnoteRef":59,"id":1239},[656],"user-content-fnref-7-2",[1241],{"type":70,"value":1216},{"type":65,"tag":576,"props":1243,"children":1244},{},[1245],{"type":70,"value":589},{"type":65,"tag":576,"props":1247,"children":1248},{},[1249],{"type":70,"value":642},{"type":65,"tag":506,"props":1251,"children":1252},{},[1253,1262,1266,1270,1274,1278,1282,1286],{"type":65,"tag":576,"props":1254,"children":1255},{},[1256],{"type":65,"tag":85,"props":1257,"children":1259},{"className":1258},[],[1260],{"type":70,"value":1261},"websocket.bufferedAmount",{"type":65,"tag":576,"props":1263,"children":1264},{},[1265],{"type":70,"value":642},{"type":65,"tag":576,"props":1267,"children":1268},{},[1269],{"type":70,"value":642},{"type":65,"tag":576,"props":1271,"children":1272},{},[1273],{"type":70,"value":642},{"type":65,"tag":576,"props":1275,"children":1276},{},[1277],{"type":70,"value":589},{"type":65,"tag":576,"props":1279,"children":1280},{},[1281],{"type":70,"value":589},{"type":65,"tag":576,"props":1283,"children":1284},{},[1285],{"type":70,"value":589},{"type":65,"tag":576,"props":1287,"children":1288},{},[1289],{"type":70,"value":642},{"type":65,"tag":1291,"props":1292,"children":1295},"section",{"className":1293,"dataFootnotes":59},[1294],"footnotes",[1296,1303],{"type":65,"tag":73,"props":1297,"children":1300},{"className":1298,"id":656},[1299],"sr-only",[1301],{"type":70,"value":1302},"Footnotes",{"type":65,"tag":1304,"props":1305,"children":1306},"ol",{},[1307,1359,1389,1417,1465,1537,1630,1665],{"type":65,"tag":378,"props":1308,"children":1310},{"id":1309},"user-content-fn-1",[1311,1313,1322,1324,1335,1336,1347,1348],{"type":70,"value":1312},"pubsub is not natively handled by runtime. peers are internally tracked. ",{"type":65,"tag":97,"props":1314,"children":1319},{"href":1315,"ariaLabel":1316,"className":1317,"dataFootnoteBackref":59},"#user-content-fnref-1","Back to reference 1",[1318],"data-footnote-backref",[1320],{"type":70,"value":1321},"↩",{"type":70,"value":1323}," ",{"type":65,"tag":97,"props":1325,"children":1329},{"href":1326,"ariaLabel":1327,"className":1328,"dataFootnoteBackref":59},"#user-content-fnref-1-2","Back to reference 1-2",[1318],[1330,1331],{"type":70,"value":1321},{"type":65,"tag":649,"props":1332,"children":1333},{},[1334],{"type":70,"value":774},{"type":70,"value":1323},{"type":65,"tag":97,"props":1337,"children":1341},{"href":1338,"ariaLabel":1339,"className":1340,"dataFootnoteBackref":59},"#user-content-fnref-1-3","Back to reference 1-3",[1318],[1342,1343],{"type":70,"value":1321},{"type":65,"tag":649,"props":1344,"children":1345},{},[1346],{"type":70,"value":838},{"type":70,"value":1323},{"type":65,"tag":97,"props":1349,"children":1353},{"href":1350,"ariaLabel":1351,"className":1352,"dataFootnoteBackref":59},"#user-content-fnref-1-4","Back to reference 1-4",[1318],[1354,1355],{"type":70,"value":1321},{"type":65,"tag":649,"props":1356,"children":1357},{},[1358],{"type":70,"value":857},{"type":65,"tag":378,"props":1360,"children":1362},{"id":1361},"user-content-fn-2",[1363,1368,1370,1377,1378],{"type":65,"tag":85,"props":1364,"children":1366},{"className":1365},[],[1367],{"type":70,"value":715},{"type":70,"value":1369}," will be used for compatibility. ",{"type":65,"tag":97,"props":1371,"children":1375},{"href":1372,"ariaLabel":1373,"className":1374,"dataFootnoteBackref":59},"#user-content-fnref-2","Back to reference 2",[1318],[1376],{"type":70,"value":1321},{"type":70,"value":1323},{"type":65,"tag":97,"props":1379,"children":1383},{"href":1380,"ariaLabel":1381,"className":1382,"dataFootnoteBackref":59},"#user-content-fnref-2-2","Back to reference 2-2",[1318],[1384,1385],{"type":70,"value":1321},{"type":65,"tag":649,"props":1386,"children":1387},{},[1388],{"type":70,"value":774},{"type":65,"tag":378,"props":1390,"children":1392},{"id":1391},"user-content-fn-30",[1393,1395,1401,1403,1408,1410],{"type":70,"value":1394},"After durable object's hibernation, only ",{"type":65,"tag":85,"props":1396,"children":1398},{"className":1397},[],[1399],{"type":70,"value":1400},"request.url",{"type":70,"value":1402}," (and ",{"type":65,"tag":85,"props":1404,"children":1406},{"className":1405},[],[1407],{"type":70,"value":90},{"type":70,"value":1409},") remain available due to 2048 byte in-memory state limit. ",{"type":65,"tag":97,"props":1411,"children":1415},{"href":1412,"ariaLabel":1413,"className":1414,"dataFootnoteBackref":59},"#user-content-fnref-30","Back to reference 3",[1318],[1416],{"type":70,"value":1321},{"type":65,"tag":378,"props":1418,"children":1420},{"id":1419},"user-content-fn-31",[1421,1423,1428,1430,1436,1438,1444,1446,1453,1454],{"type":70,"value":1422},"using a proxy for ",{"type":65,"tag":97,"props":1424,"children":1426},{"href":133,"rel":1425},[101],[1427],{"type":70,"value":137},{"type":70,"value":1429}," compatible interface (",{"type":65,"tag":85,"props":1431,"children":1433},{"className":1432},[],[1434],{"type":70,"value":1435},"url",{"type":70,"value":1437},", ",{"type":65,"tag":85,"props":1439,"children":1441},{"className":1440},[],[1442],{"type":70,"value":1443},"headers",{"type":70,"value":1445}," only) wrapping Node.js requests. ",{"type":65,"tag":97,"props":1447,"children":1451},{"href":1448,"ariaLabel":1449,"className":1450,"dataFootnoteBackref":59},"#user-content-fnref-31","Back to reference 4",[1318],[1452],{"type":70,"value":1321},{"type":70,"value":1323},{"type":65,"tag":97,"props":1455,"children":1459},{"href":1456,"ariaLabel":1457,"className":1458,"dataFootnoteBackref":59},"#user-content-fnref-31-2","Back to reference 4-2",[1318],[1460,1461],{"type":70,"value":1321},{"type":65,"tag":649,"props":1462,"children":1463},{},[1464],{"type":70,"value":774},{"type":65,"tag":378,"props":1466,"children":1468},{"id":1467},"user-content-fn-4",[1469,1479,1481,1492,1494,1501,1502,1513,1514,1525,1526],{"type":65,"tag":97,"props":1470,"children":1473},{"href":1471,"rel":1472},"https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/extensions",[101],[1474],{"type":65,"tag":85,"props":1475,"children":1477},{"className":1476},[],[1478],{"type":70,"value":966},{"type":70,"value":1480}," is polyfilled using ",{"type":65,"tag":97,"props":1482,"children":1485},{"href":1483,"rel":1484},"https://developer.mozilla.org/en-US/docs/Web/HTTP/Protocol_upgrade_mechanism#websocket-specific_headers",[101],[1486],{"type":65,"tag":85,"props":1487,"children":1489},{"className":1488},[],[1490],{"type":70,"value":1491},"sec-websocket-extensions",{"type":70,"value":1493}," request header. ",{"type":65,"tag":97,"props":1495,"children":1499},{"href":1496,"ariaLabel":1497,"className":1498,"dataFootnoteBackref":59},"#user-content-fnref-4","Back to reference 5",[1318],[1500],{"type":70,"value":1321},{"type":70,"value":1323},{"type":65,"tag":97,"props":1503,"children":1507},{"href":1504,"ariaLabel":1505,"className":1506,"dataFootnoteBackref":59},"#user-content-fnref-4-2","Back to reference 5-2",[1318],[1508,1509],{"type":70,"value":1321},{"type":65,"tag":649,"props":1510,"children":1511},{},[1512],{"type":70,"value":774},{"type":70,"value":1323},{"type":65,"tag":97,"props":1515,"children":1519},{"href":1516,"ariaLabel":1517,"className":1518,"dataFootnoteBackref":59},"#user-content-fnref-4-3","Back to reference 5-3",[1318],[1520,1521],{"type":70,"value":1321},{"type":65,"tag":649,"props":1522,"children":1523},{},[1524],{"type":70,"value":838},{"type":70,"value":1323},{"type":65,"tag":97,"props":1527,"children":1531},{"href":1528,"ariaLabel":1529,"className":1530,"dataFootnoteBackref":59},"#user-content-fnref-4-4","Back to reference 5-4",[1318],[1532,1533],{"type":70,"value":1321},{"type":65,"tag":649,"props":1534,"children":1535},{},[1536],{"type":70,"value":857},{"type":65,"tag":378,"props":1538,"children":1540},{"id":1539},"user-content-fn-5",[1541,1551,1552,1562,1563,1570,1571,1582,1583,1594,1595,1606,1607,1618,1619],{"type":65,"tag":97,"props":1542,"children":1545},{"href":1543,"rel":1544},"https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/protocol",[101],[1546],{"type":65,"tag":85,"props":1547,"children":1549},{"className":1548},[],[1550],{"type":70,"value":1044},{"type":70,"value":1480},{"type":65,"tag":97,"props":1553,"children":1555},{"href":1483,"rel":1554},[101],[1556],{"type":65,"tag":85,"props":1557,"children":1559},{"className":1558},[],[1560],{"type":70,"value":1561},"sec-websocket-protocol",{"type":70,"value":1493},{"type":65,"tag":97,"props":1564,"children":1568},{"href":1565,"ariaLabel":1566,"className":1567,"dataFootnoteBackref":59},"#user-content-fnref-5","Back to reference 6",[1318],[1569],{"type":70,"value":1321},{"type":70,"value":1323},{"type":65,"tag":97,"props":1572,"children":1576},{"href":1573,"ariaLabel":1574,"className":1575,"dataFootnoteBackref":59},"#user-content-fnref-5-2","Back to reference 6-2",[1318],[1577,1578],{"type":70,"value":1321},{"type":65,"tag":649,"props":1579,"children":1580},{},[1581],{"type":70,"value":774},{"type":70,"value":1323},{"type":65,"tag":97,"props":1584,"children":1588},{"href":1585,"ariaLabel":1586,"className":1587,"dataFootnoteBackref":59},"#user-content-fnref-5-3","Back to reference 6-3",[1318],[1589,1590],{"type":70,"value":1321},{"type":65,"tag":649,"props":1591,"children":1592},{},[1593],{"type":70,"value":838},{"type":70,"value":1323},{"type":65,"tag":97,"props":1596,"children":1600},{"href":1597,"ariaLabel":1598,"className":1599,"dataFootnoteBackref":59},"#user-content-fnref-5-4","Back to reference 6-4",[1318],[1601,1602],{"type":70,"value":1321},{"type":65,"tag":649,"props":1603,"children":1604},{},[1605],{"type":70,"value":857},{"type":70,"value":1323},{"type":65,"tag":97,"props":1608,"children":1612},{"href":1609,"ariaLabel":1610,"className":1611,"dataFootnoteBackref":59},"#user-content-fnref-5-5","Back to reference 6-5",[1318],[1613,1614],{"type":70,"value":1321},{"type":65,"tag":649,"props":1615,"children":1616},{},[1617],{"type":70,"value":981},{"type":70,"value":1323},{"type":65,"tag":97,"props":1620,"children":1624},{"href":1621,"ariaLabel":1622,"className":1623,"dataFootnoteBackref":59},"#user-content-fnref-5-6","Back to reference 6-6",[1318],[1625,1626],{"type":70,"value":1321},{"type":65,"tag":649,"props":1627,"children":1628},{},[1629],{"type":70,"value":1059},{"type":65,"tag":378,"props":1631,"children":1633},{"id":1632},"user-content-fn-6",[1634,1644,1646,1653,1654],{"type":65,"tag":97,"props":1635,"children":1638},{"href":1636,"rel":1637},"https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/readyState",[101],[1639],{"type":65,"tag":85,"props":1640,"children":1642},{"className":1641},[],[1643],{"type":70,"value":1141},{"type":70,"value":1645}," is polyfilled by tracking open/close events. ",{"type":65,"tag":97,"props":1647,"children":1651},{"href":1648,"ariaLabel":1649,"className":1650,"dataFootnoteBackref":59},"#user-content-fnref-6","Back to reference 7",[1318],[1652],{"type":70,"value":1321},{"type":70,"value":1323},{"type":65,"tag":97,"props":1655,"children":1659},{"href":1656,"ariaLabel":1657,"className":1658,"dataFootnoteBackref":59},"#user-content-fnref-6-2","Back to reference 7-2",[1318],[1660,1661],{"type":70,"value":1321},{"type":65,"tag":649,"props":1662,"children":1663},{},[1664],{"type":70,"value":774},{"type":65,"tag":378,"props":1666,"children":1668},{"id":1667},"user-content-fn-7",[1669,1671,1677,1679,1685,1687,1697,1699,1706,1707],{"type":70,"value":1670},"Some runtimes have non standard values including ",{"type":65,"tag":85,"props":1672,"children":1674},{"className":1673},[],[1675],{"type":70,"value":1676},"\"nodebuffer\"",{"type":70,"value":1678}," and ",{"type":65,"tag":85,"props":1680,"children":1682},{"className":1681},[],[1683],{"type":70,"value":1684},"\"uint8array\"",{"type":70,"value":1686},". crossws auto converts them for ",{"type":65,"tag":97,"props":1688,"children":1690},{"href":1689},"/guide/message#messagedata",[1691],{"type":65,"tag":85,"props":1692,"children":1694},{"className":1693},[],[1695],{"type":70,"value":1696},"message.data",{"type":70,"value":1698},". ",{"type":65,"tag":97,"props":1700,"children":1704},{"href":1701,"ariaLabel":1702,"className":1703,"dataFootnoteBackref":59},"#user-content-fnref-7","Back to reference 8",[1318],[1705],{"type":70,"value":1321},{"type":70,"value":1323},{"type":65,"tag":97,"props":1708,"children":1712},{"href":1709,"ariaLabel":1710,"className":1711,"dataFootnoteBackref":59},"#user-content-fnref-7-2","Back to reference 8-2",[1318],[1713,1714],{"type":70,"value":1321},{"type":65,"tag":649,"props":1715,"children":1716},{},[1717],{"type":70,"value":774},{"title":59,"searchDepth":1719,"depth":1719,"links":1720},2,[1721,1731,1739,1740],{"id":75,"depth":1719,"text":78,"children":1722},[1723,1725,1726,1727,1728,1729,1730],{"id":82,"depth":1724,"text":90},3,{"id":109,"depth":1724,"text":116},{"id":150,"depth":1724,"text":157},{"id":178,"depth":1724,"text":185},{"id":226,"depth":1724,"text":233},{"id":249,"depth":1724,"text":256},{"id":264,"depth":1724,"text":271},{"id":279,"depth":1719,"text":282,"children":1732},[1733,1734,1735,1736,1737,1738],{"id":285,"depth":1724,"text":292},{"id":300,"depth":1724,"text":307},{"id":319,"depth":1724,"text":326},{"id":337,"depth":1724,"text":344},{"id":355,"depth":1724,"text":362},{"id":467,"depth":1724,"text":462},{"id":493,"depth":1719,"text":496},{"id":656,"depth":1719,"text":1302},"markdown","content:1.guide:3.peer.md","content","1.guide/3.peer.md","1.guide/3.peer","md",[1748,1750],{"_path":12,"title":11,"description":1749},"Using hooks, you can define a WebSocket server that works across runtimes with the same syntax.",{"_path":20,"title":19,"description":59},1747776031616]