[{"data":1,"prerenderedAt":687},["ShallowReactive",2],{"navigation":3,"\u002Fgetting-started\u002Fintroduction":129,"\u002Fgetting-started\u002Fintroduction-surround":684},[4,27,65,107,125],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":26},"Getting started","i-lucide-rocket","\u002Fgetting-started","1.getting-started",[10,14,18,22],{"title":11,"path":12,"stem":13},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction",{"title":15,"path":16,"stem":17},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation",{"title":19,"path":20,"stem":21},"Quick start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start",{"title":23,"path":24,"stem":25},"MSRV","\u002Fgetting-started\u002Fmsrv","1.getting-started\u002F9.msrv",false,{"title":28,"icon":29,"path":30,"stem":31,"children":32,"page":26},"Client","i-lucide-plug-zap","\u002Fclient","2.client",[33,37,41,45,49,53,57,61],{"title":34,"path":35,"stem":36},"Configuration","\u002Fclient\u002Fconfiguration","2.client\u002F1.configuration",{"title":38,"path":39,"stem":40},"Events and acks","\u002Fclient\u002Fevents-and-acks","2.client\u002F2.events-and-acks",{"title":42,"path":43,"stem":44},"Connection state","\u002Fclient\u002Fconnection-state","2.client\u002F3.connection-state",{"title":46,"path":47,"stem":48},"Transports and proxies","\u002Fclient\u002Ftransports-and-proxies","2.client\u002F4.transports-and-proxies",{"title":50,"path":51,"stem":52},"TLS","\u002Fclient\u002Ftls","2.client\u002F5.tls",{"title":54,"path":55,"stem":56},"Errors","\u002Fclient\u002Ferrors","2.client\u002F6.errors",{"title":58,"path":59,"stem":60},"Debugging","\u002Fclient\u002Fdebugging","2.client\u002F7.debugging",{"title":62,"path":63,"stem":64},"Blocking client","\u002Fclient\u002Fblocking","2.client\u002F8.blocking",{"title":66,"icon":67,"path":68,"stem":69,"children":70,"page":26},"Tauri plugin","i-simple-icons-tauri","\u002Ftauri","3.tauri",[71,75,79,83,87,91,95,99,103],{"title":72,"path":73,"stem":74},"Setup","\u002Ftauri\u002Fsetup","3.tauri\u002F1.setup",{"title":76,"path":77,"stem":78},"JavaScript API","\u002Ftauri\u002Fjavascript-api","3.tauri\u002F2.javascript-api",{"title":80,"path":81,"stem":82},"Rust API","\u002Ftauri\u002Frust-api","3.tauri\u002F3.rust-api",{"title":84,"path":85,"stem":86},"Permissions","\u002Ftauri\u002Fpermissions","3.tauri\u002F4.permissions",{"title":88,"path":89,"stem":90},"Security","\u002Ftauri\u002Fsecurity","3.tauri\u002F5.security",{"title":92,"path":93,"stem":94},"Messages and errors","\u002Ftauri\u002Fmessages-and-errors","3.tauri\u002F6.messages-and-errors",{"title":96,"path":97,"stem":98},"Troubleshooting","\u002Ftauri\u002Ftroubleshooting","3.tauri\u002F7.troubleshooting",{"title":100,"path":101,"stem":102},"Example app","\u002Ftauri\u002Fexample","3.tauri\u002F8.example",{"title":104,"path":105,"stem":106},"Plugin changelog","\u002Ftauri\u002Fchangelog","3.tauri\u002F9.changelog",{"title":108,"icon":109,"path":110,"stem":111,"children":112,"page":26},"Guides","i-lucide-book-open","\u002Fguides","4.guides",[113,117,121],{"title":114,"path":115,"stem":116},"Migration from rust_socketio","\u002Fguides\u002Fmigration","4.guides\u002F1.migration",{"title":118,"path":119,"stem":120},"Comparison","\u002Fguides\u002Fcomparison","4.guides\u002F2.comparison",{"title":122,"path":123,"stem":124},"Contributing","\u002Fguides\u002Fcontributing","4.guides\u002F3.contributing",{"title":126,"path":127,"stem":128},"Changelog","\u002Fchangelog","9.changelog",{"id":130,"title":11,"body":131,"description":678,"extension":679,"links":680,"meta":681,"navigation":276,"path":12,"seo":682,"stem":13,"__hash__":683},"docs\u002F1.getting-started\u002F1.introduction.md",{"type":132,"value":133,"toc":672},"minimark",[134,150,198,224,522,527,618,622,634,638,643,647,668],[135,136,137,141,142,149],"p",{},[138,139,140],"code",{},"socketio-next"," is a ",[143,144,148],"a",{"href":145,"rel":146},"https:\u002F\u002Fsocket.io",[147],"nofollow","Socket.IO"," v4 client for Rust that behaves like the reference JavaScript client (socket.io-client 4.8 \u002F engine.io-client 6.6):",[151,152,153,165,171,177,187,193],"ul",{},[154,155,156,160,161,164],"li",{},[157,158,159],"strong",{},"namespaces"," and ",[157,162,163],{},"auth"," (a JSON object, or a closure that runs before every attempt);",[154,166,167,170],{},[157,168,169],{},"acks in both directions",": awaitable acks with a timeout, and answers to the server's callbacks;",[154,172,173,176],{},[157,174,175],{},"binary data anywhere"," in the arguments, with the socket.io-parser encoding;",[154,178,179,182,183,186],{},[157,180,181],{},"reconnection"," with the same backoff (delay, maximum, jitter) and ",[157,184,185],{},"connection state recovery",";",[154,188,189,192],{},[157,190,191],{},"polling and websocket"," transports, upgrade or websocket only, HTTP proxies;",[154,194,195,197],{},[157,196,50],{}," through rustls (default) or native-tls, private CAs, the operating system's trust store.",[135,199,200,201,204,205,210,211,210,214,217,218,223],{},"The client is async (tokio). The ",[138,202,203],{},"blocking"," feature adds the same client with blocking methods. State and errors are typed: ",[143,206,207],{"href":43},[138,208,209],{},"ConnectionState",", ",[138,212,213],{},"DisconnectReason",[138,215,216],{},"LinkInfo"," and one cloneable ",[143,219,220],{"href":55},[138,221,222],{},"Error",".",[225,226,231],"pre",{"className":227,"code":228,"language":229,"meta":230,"style":230},"language-rust shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","use socketio_next::{Client, ClientBuilder, ConnectionState, Event};\n\nlet client = ClientBuilder::new(\"http:\u002F\u002Flocalhost:3000\")\n    .on(\"chat\", |event: Event, _: Client| async move {\n        println!(\"chat: {:?}\", event.payload());\n    })\n    .on_state_change(|state: ConnectionState, _: Client| async move {\n        println!(\"{state:?}\");\n    })\n    .connect()\n    .await?;\nclient.emit(\"chat\", \"hello\")?;\n","rust","",[138,232,233,271,278,316,369,404,410,444,462,467,478,490],{"__ignoreMap":230},[234,235,238,242,246,250,252,255,258,260,263,265,268],"span",{"class":236,"line":237},"line",1,[234,239,241],{"class":240},"sbssI","use",[234,243,245],{"class":244},"sBMFI"," socketio_next",[234,247,249],{"class":248},"sMK4o","::{",[234,251,28],{"class":244},[234,253,254],{"class":248},",",[234,256,257],{"class":244}," ClientBuilder",[234,259,254],{"class":248},[234,261,262],{"class":244}," ConnectionState",[234,264,254],{"class":248},[234,266,267],{"class":244}," Event",[234,269,270],{"class":248},"};\n",[234,272,274],{"class":236,"line":273},2,[234,275,277],{"emptyLinePlaceholder":276},true,"\n",[234,279,281,285,289,292,294,297,301,304,307,311,313],{"class":236,"line":280},3,[234,282,284],{"class":283},"spNyl","let",[234,286,288],{"class":287},"sTEyZ"," client ",[234,290,291],{"class":248},"=",[234,293,257],{"class":244},[234,295,296],{"class":248},"::",[234,298,300],{"class":299},"s2Zo4","new",[234,302,303],{"class":248},"(",[234,305,306],{"class":248},"\"",[234,308,310],{"class":309},"sfazB","http:\u002F\u002Flocalhost:3000",[234,312,306],{"class":248},[234,314,315],{"class":248},")\n",[234,317,319,322,325,327,329,332,334,336,339,342,345,347,349,352,354,357,360,363,366],{"class":236,"line":318},4,[234,320,321],{"class":248},"    .",[234,323,324],{"class":299},"on",[234,326,303],{"class":248},[234,328,306],{"class":248},[234,330,331],{"class":309},"chat",[234,333,306],{"class":248},[234,335,254],{"class":248},[234,337,338],{"class":248}," |",[234,340,341],{"class":287},"event",[234,343,344],{"class":248},":",[234,346,267],{"class":244},[234,348,254],{"class":248},[234,350,351],{"class":287}," _",[234,353,344],{"class":248},[234,355,356],{"class":244}," Client",[234,358,359],{"class":248},"|",[234,361,362],{"class":240}," async",[234,364,365],{"class":240}," move",[234,367,368],{"class":248}," {\n",[234,370,372,375,377,379,382,385,388,391,393,396,398,401],{"class":236,"line":371},5,[234,373,374],{"class":299},"        println!",[234,376,303],{"class":248},[234,378,306],{"class":248},[234,380,381],{"class":309},"chat: ",[234,383,384],{"class":248},"{",[234,386,387],{"class":309},":?",[234,389,390],{"class":248},"}\"",[234,392,254],{"class":248},[234,394,395],{"class":287}," event",[234,397,223],{"class":248},[234,399,400],{"class":299},"payload",[234,402,403],{"class":248},"());\n",[234,405,407],{"class":236,"line":406},6,[234,408,409],{"class":248},"    })\n",[234,411,413,415,418,421,424,426,428,430,432,434,436,438,440,442],{"class":236,"line":412},7,[234,414,321],{"class":248},[234,416,417],{"class":299},"on_state_change",[234,419,420],{"class":248},"(|",[234,422,423],{"class":287},"state",[234,425,344],{"class":248},[234,427,262],{"class":244},[234,429,254],{"class":248},[234,431,351],{"class":287},[234,433,344],{"class":248},[234,435,356],{"class":244},[234,437,359],{"class":248},[234,439,362],{"class":240},[234,441,365],{"class":240},[234,443,368],{"class":248},[234,445,447,449,451,454,457,459],{"class":236,"line":446},8,[234,448,374],{"class":299},[234,450,303],{"class":248},[234,452,453],{"class":248},"\"{",[234,455,456],{"class":309},"state:?",[234,458,390],{"class":248},[234,460,461],{"class":248},");\n",[234,463,465],{"class":236,"line":464},9,[234,466,409],{"class":248},[234,468,470,472,475],{"class":236,"line":469},10,[234,471,321],{"class":248},[234,473,474],{"class":299},"connect",[234,476,477],{"class":248},"()\n",[234,479,481,483,487],{"class":236,"line":480},11,[234,482,321],{"class":248},[234,484,486],{"class":485},"s7zQu","await",[234,488,489],{"class":248},"?;\n",[234,491,493,496,498,501,503,505,507,509,511,514,517,519],{"class":236,"line":492},12,[234,494,495],{"class":287},"client",[234,497,223],{"class":248},[234,499,500],{"class":299},"emit",[234,502,303],{"class":248},[234,504,306],{"class":248},[234,506,331],{"class":309},[234,508,306],{"class":248},[234,510,254],{"class":248},[234,512,513],{"class":248}," \"",[234,515,516],{"class":309},"hello",[234,518,306],{"class":248},[234,520,521],{"class":248},")?;\n",[523,524,526],"h2",{"id":525},"what-is-in-the-repository","What is in the repository",[528,529,530,546],"table",{},[531,532,533],"thead",{},[534,535,536,540,543],"tr",{},[537,538,539],"th",{},"Package",[537,541,542],{},"Where",[537,544,545],{},"What",[547,548,549,576,599],"tbody",{},[534,550,551,560,565],{},[552,553,554],"td",{},[143,555,558],{"href":556,"rel":557},"https:\u002F\u002Fcrates.io\u002Fcrates\u002Fsocketio-next",[147],[138,559,140],{},[552,561,562],{},[138,563,564],{},"crates\u002Fsocketio-next",[552,566,567,568,571,572,575],{},"The client, ",[138,569,570],{},"engineio"," (transport layer) and ",[138,573,574],{},"protocol"," (packet codecs, no I\u002FO).",[534,577,578,587,592],{},[552,579,580],{},[143,581,584],{"href":582,"rel":583},"https:\u002F\u002Fcrates.io\u002Fcrates\u002Ftauri-plugin-socketio",[147],[138,585,586],{},"tauri-plugin-socketio",[552,588,589],{},[138,590,591],{},"crates\u002Ftauri-plugin-socketio",[552,593,594,595,598],{},"A ",[143,596,597],{"href":73},"Tauri 2 plugin",": named clients shared by Rust and the webviews.",[534,600,601,610,615],{},[552,602,603],{},[143,604,607],{"href":605,"rel":606},"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Ftauri-plugin-socketio-api",[147],[138,608,609],{},"tauri-plugin-socketio-api",[552,611,612],{},[138,613,614],{},"crates\u002Ftauri-plugin-socketio\u002Fguest-js",[552,616,617],{},"The plugin's JavaScript API, close to socket.io-client.",[523,619,621],{"id":620},"where-it-comes-from","Where it comes from",[135,623,624,625,630,631,223],{},"socketio-next started as a fork of ",[143,626,629],{"href":627,"rel":628},"https:\u002F\u002Fgithub.com\u002F1c3t3a\u002Frust-socketio",[147],"rust_socketio"," 0.6.0 (Bastian Kersting and contributors). The protocol code was kept and corrected; the client was rewritten. It is a different crate: code that uses rust_socketio needs the ",[143,632,633],{"href":115},"migration",[523,635,637],{"id":636},"checked-against-the-reference-client","Checked against the reference client",[135,639,640,641,223],{},"The socket.io-parser and engine.io-parser test vectors are ported, the connection and socket cases of socket.io-client and engine.io-client run against Node servers, and differential tests run one scenario with the Node client and with this client against a recording server and compare what went over the wire. What is deliberately not implemented is listed in ",[143,642,118],{"href":119},[523,644,646],{"id":645},"next","Next",[151,648,649,654,659],{},[154,650,651,653],{},[143,652,15],{"href":16},": Cargo features and TLS backends.",[154,655,656,658],{},[143,657,19],{"href":20},": connect, emit, acks, state.",[154,660,661,663,664,667],{},[143,662,34],{"href":35},": every ",[138,665,666],{},"ClientBuilder"," option.",[669,670,671],"style",{},"html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}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":230,"searchDepth":273,"depth":280,"links":673},[674,675,676,677],{"id":525,"depth":273,"text":526},{"id":620,"depth":273,"text":621},{"id":636,"depth":273,"text":637},{"id":645,"depth":273,"text":646},"What socketio-next is, what it does like socket.io-client, and what lives in this repository.","md",null,{},{"title":11,"description":678},"RW9_szIXmI03JgvzAJSlrPX8HeG2eI9apY53_SRs1dA",[680,685],{"title":15,"path":16,"stem":17,"description":686,"children":-1},"Add socketio-next, pick a TLS backend and the optional features.",1795285663243]