[{"data":1,"prerenderedAt":769},["ShallowReactive",2],{"navigation":3,"\u002Ftauri\u002Fsetup":129,"\u002Ftauri\u002Fsetup-surround":764},[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":72,"body":131,"description":758,"extension":759,"links":760,"meta":761,"navigation":566,"path":73,"seo":762,"stem":74,"__hash__":763},"docs\u002F3.tauri\u002F1.setup.md",{"type":132,"value":133,"toc":751},"minimark",[134,147,193,196,201,247,269,280,284,334,345,414,417,513,524,528,713,717,741,747],[135,136,137,141,142,146],"p",{},[138,139,140],"code",{},"tauri-plugin-socketio"," is a Tauri 2 plugin for Socket.IO v4 on top of socketio-next: one registry of ",[143,144,145],"strong",{},"named clients"," that Rust and the webviews share.",[148,149,150,158,190],"ul",{},[151,152,153,154,157],"li",{},"Rust connects clients through the plugin, or registers clients it built itself (for example in core code that must not depend on Tauri), optionally ",[143,155,156],{},"read-only"," for the webview.",[151,159,160,161,164,165,168,169,172,173,172,176,179,180,179,183,179,186,189],{},"JS connects its own clients (",[138,162,163],{},"connect",") or attaches to registered ones (",[138,166,167],{},"attach",") with an API close to socket.io-client: ",[138,170,171],{},"emit",", ",[138,174,175],{},"emitWithAck",[138,177,178],{},"on"," \u002F ",[138,181,182],{},"once",[138,184,185],{},"off",[138,187,188],{},"onAny",", acks for server callbacks, binary anywhere in the arguments.",[151,191,192],{},"Events and state transitions go to each webview over its own IPC channel, in order, filtered by event name if asked. Subscriptions end when the webview reloads or closes.",[135,194,195],{},"The socket runs in Rust: no CORS, no browser websocket limits, TLS through rustls (or the platform library), and the connection survives page reloads.",[197,198,200],"h2",{"id":199},"install","Install",[202,203,209],"pre",{"className":204,"code":205,"filename":206,"language":207,"meta":208,"style":208},"language-toml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","[dependencies]\ntauri-plugin-socketio = \"0.1\"\n","src-tauri\u002FCargo.toml","toml","",[138,210,211,227],{"__ignoreMap":208},[212,213,216,220,224],"span",{"class":214,"line":215},"line",1,[212,217,219],{"class":218},"sMK4o","[",[212,221,223],{"class":222},"sBMFI","dependencies",[212,225,226],{"class":218},"]\n",[212,228,230,234,237,240,244],{"class":214,"line":229},2,[212,231,233],{"class":232},"sTEyZ","tauri-plugin-socketio ",[212,235,236],{"class":218},"=",[212,238,239],{"class":218}," \"",[212,241,243],{"class":242},"sfazB","0.1",[212,245,246],{"class":218},"\"\n",[202,248,252],{"className":249,"code":250,"language":251,"meta":208,"style":208},"language-sh shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm add tauri-plugin-socketio-api   # or npm \u002F yarn\n","sh",[138,253,254],{"__ignoreMap":208},[212,255,256,259,262,265],{"class":214,"line":215},[212,257,258],{"class":222},"pnpm",[212,260,261],{"class":242}," add",[212,263,264],{"class":242}," tauri-plugin-socketio-api",[212,266,268],{"class":267},"sHwdD","   # or npm \u002F yarn\n",[135,270,271,272,275,276,279],{},"The crate re-exports the client as ",[138,273,274],{},"tauri_plugin_socketio::socketio_next","; add ",[138,277,278],{},"socketio-next"," yourself only when other crates of yours use it (same version).",[197,281,283],{"id":282},"register-the-plugin","Register the plugin",[202,285,290],{"className":286,"code":287,"filename":288,"language":289,"meta":208,"style":208},"language-rust shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","tauri::Builder::default()\n    .plugin(tauri_plugin_socketio::init())\n","src-tauri\u002Fsrc\u002Flib.rs","rust",[138,291,292,312],{"__ignoreMap":208},[212,293,294,297,300,303,305,309],{"class":214,"line":215},[212,295,296],{"class":222},"tauri",[212,298,299],{"class":218},"::",[212,301,302],{"class":222},"Builder",[212,304,299],{"class":218},[212,306,308],{"class":307},"s2Zo4","default",[212,310,311],{"class":218},"()\n",[212,313,314,317,320,323,326,328,331],{"class":214,"line":229},[212,315,316],{"class":218},"    .",[212,318,319],{"class":307},"plugin",[212,321,322],{"class":218},"(",[212,324,325],{"class":222},"tauri_plugin_socketio",[212,327,299],{"class":218},[212,329,330],{"class":307},"init",[212,332,333],{"class":218},"())\n",[135,335,336,339,340,344],{},[138,337,338],{},"init()"," allows the webview to connect to any URL. To restrict it, build the plugin with an allow-list (see ",[341,342,88],"a",{"href":343},"\u002Ftauri\u002Fsecurity#url-allow-list","):",[202,346,348],{"className":286,"code":347,"language":289,"meta":208,"style":208},".plugin(\n    tauri_plugin_socketio::Builder::new()\n        .allow_url_prefix(\"https:\u002F\u002Fapi.example.com\")\n        .build(),\n)\n",[138,349,350,360,376,398,409],{"__ignoreMap":208},[212,351,352,355,357],{"class":214,"line":215},[212,353,354],{"class":218},".",[212,356,319],{"class":307},[212,358,359],{"class":218},"(\n",[212,361,362,365,367,369,371,374],{"class":214,"line":229},[212,363,364],{"class":222},"    tauri_plugin_socketio",[212,366,299],{"class":218},[212,368,302],{"class":222},[212,370,299],{"class":218},[212,372,373],{"class":307},"new",[212,375,311],{"class":218},[212,377,379,382,385,387,390,393,395],{"class":214,"line":378},3,[212,380,381],{"class":218},"        .",[212,383,384],{"class":307},"allow_url_prefix",[212,386,322],{"class":218},[212,388,389],{"class":218},"\"",[212,391,392],{"class":242},"https:\u002F\u002Fapi.example.com",[212,394,389],{"class":218},[212,396,397],{"class":218},")\n",[212,399,401,403,406],{"class":214,"line":400},4,[212,402,381],{"class":218},[212,404,405],{"class":307},"build",[212,407,408],{"class":218},"(),\n",[212,410,412],{"class":214,"line":411},5,[212,413,397],{"class":218},[197,415,84],{"id":416},"permissions",[202,418,423],{"className":419,"code":420,"filename":421,"language":422,"meta":208,"style":208},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"identifier\": \"default\",\n  \"windows\": [\"main\"],\n  \"permissions\": [\"core:default\", \"socketio:default\"]\n}\n","src-tauri\u002Fcapabilities\u002Fdefault.json","json",[138,424,425,430,453,477,508],{"__ignoreMap":208},[212,426,427],{"class":214,"line":215},[212,428,429],{"class":218},"{\n",[212,431,432,435,439,441,444,446,448,450],{"class":214,"line":229},[212,433,434],{"class":218},"  \"",[212,436,438],{"class":437},"spNyl","identifier",[212,440,389],{"class":218},[212,442,443],{"class":218},":",[212,445,239],{"class":218},[212,447,308],{"class":242},[212,449,389],{"class":218},[212,451,452],{"class":218},",\n",[212,454,455,457,460,462,464,467,469,472,474],{"class":214,"line":378},[212,456,434],{"class":218},[212,458,459],{"class":437},"windows",[212,461,389],{"class":218},[212,463,443],{"class":218},[212,465,466],{"class":218}," [",[212,468,389],{"class":218},[212,470,471],{"class":242},"main",[212,473,389],{"class":218},[212,475,476],{"class":218},"],\n",[212,478,479,481,483,485,487,489,491,494,496,499,501,504,506],{"class":214,"line":400},[212,480,434],{"class":218},[212,482,416],{"class":437},[212,484,389],{"class":218},[212,486,443],{"class":218},[212,488,466],{"class":218},[212,490,389],{"class":218},[212,492,493],{"class":242},"core:default",[212,495,389],{"class":218},[212,497,498],{"class":218},",",[212,500,239],{"class":218},[212,502,503],{"class":242},"socketio:default",[212,505,389],{"class":218},[212,507,226],{"class":218},[212,509,510],{"class":214,"line":411},[212,511,512],{"class":218},"}\n",[135,514,515,517,518,521,522,354],{},[138,516,503],{}," allows every command; ",[138,519,520],{},"socketio:allow-read"," only observes. See ",[341,523,84],{"href":85},[197,525,527],{"id":526},"first-socket","First socket",[202,529,533],{"className":530,"code":531,"language":532,"meta":208,"style":208},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { connect } from 'tauri-plugin-socketio-api'\n\nconst socket = await connect('chat', { url: 'https:\u002F\u002Fchat.example.com', auth: { token } })\nsocket.on('message', (text, from) => console.log(from, text))\nawait socket.emit('message', 'hi')\n","ts",[138,534,535,562,568,629,682],{"__ignoreMap":208},[212,536,537,541,544,547,550,553,556,559],{"class":214,"line":215},[212,538,540],{"class":539},"s7zQu","import",[212,542,543],{"class":218}," {",[212,545,546],{"class":232}," connect",[212,548,549],{"class":218}," }",[212,551,552],{"class":539}," from",[212,554,555],{"class":218}," '",[212,557,558],{"class":242},"tauri-plugin-socketio-api",[212,560,561],{"class":218},"'\n",[212,563,564],{"class":214,"line":229},[212,565,567],{"emptyLinePlaceholder":566},true,"\n",[212,569,570,573,576,578,581,583,585,588,591,593,595,597,601,603,605,608,610,612,615,617,619,622,625,627],{"class":214,"line":378},[212,571,572],{"class":437},"const",[212,574,575],{"class":232}," socket ",[212,577,236],{"class":218},[212,579,580],{"class":539}," await",[212,582,546],{"class":307},[212,584,322],{"class":232},[212,586,587],{"class":218},"'",[212,589,590],{"class":242},"chat",[212,592,587],{"class":218},[212,594,498],{"class":218},[212,596,543],{"class":218},[212,598,600],{"class":599},"swJcz"," url",[212,602,443],{"class":218},[212,604,555],{"class":218},[212,606,607],{"class":242},"https:\u002F\u002Fchat.example.com",[212,609,587],{"class":218},[212,611,498],{"class":218},[212,613,614],{"class":599}," auth",[212,616,443],{"class":218},[212,618,543],{"class":218},[212,620,621],{"class":232}," token ",[212,623,624],{"class":218},"}",[212,626,549],{"class":218},[212,628,397],{"class":232},[212,630,631,634,636,638,640,642,645,647,649,652,656,658,660,663,666,669,671,674,677,679],{"class":214,"line":400},[212,632,633],{"class":232},"socket",[212,635,354],{"class":218},[212,637,178],{"class":307},[212,639,322],{"class":232},[212,641,587],{"class":218},[212,643,644],{"class":242},"message",[212,646,587],{"class":218},[212,648,498],{"class":218},[212,650,651],{"class":218}," (",[212,653,655],{"class":654},"sHdIc","text",[212,657,498],{"class":218},[212,659,552],{"class":654},[212,661,662],{"class":218},")",[212,664,665],{"class":437}," =>",[212,667,668],{"class":232}," console",[212,670,354],{"class":218},[212,672,673],{"class":307},"log",[212,675,676],{"class":232},"(from",[212,678,498],{"class":218},[212,680,681],{"class":232}," text))\n",[212,683,684,687,690,692,694,696,698,700,702,704,706,709,711],{"class":214,"line":411},[212,685,686],{"class":539},"await",[212,688,689],{"class":232}," socket",[212,691,354],{"class":218},[212,693,171],{"class":307},[212,695,322],{"class":232},[212,697,587],{"class":218},[212,699,644],{"class":242},[212,701,587],{"class":218},[212,703,498],{"class":218},[212,705,555],{"class":218},[212,707,708],{"class":242},"hi",[212,710,587],{"class":218},[212,712,397],{"class":232},[197,714,716],{"id":715},"cargo-features","Cargo features",[135,718,719,722,723,726,727,651,730,733,734,736,737,740],{},[138,720,721],{},"rustls"," (default) and ",[138,724,725],{},"native-tls",", forwarded to socketio-next. If any crate in your build enables reqwest 0.13's ",[138,728,729],{},"rustls-no-provider",[138,731,732],{},"tauri-plugin-updater"," does), keep ",[138,735,721],{}," on, or connects fail with ",[138,738,739],{},"TlsProviderMissing",". On Android and iOS rustls with the bundled webpki roots works without setup.",[135,742,743,744,746],{},"The plugin needs Rust 1.85; the resolver then picks a tauri 2.x release that supports it (see ",[341,745,23],{"href":24},").",[748,749,750],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}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);}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}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 pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}",{"title":208,"searchDepth":229,"depth":378,"links":752},[753,754,755,756,757],{"id":199,"depth":229,"text":200},{"id":282,"depth":229,"text":283},{"id":416,"depth":229,"text":84},{"id":526,"depth":229,"text":527},{"id":715,"depth":229,"text":716},"Install tauri-plugin-socketio and its JS API, register the plugin, grant the permissions.","md",null,{},{"title":72,"description":758},"VuARF06nQCXzljf2TS5aqF4xTemr0dAYpbsX80JqsWk",[765,767],{"title":62,"path":63,"stem":64,"description":766,"children":-1},"The same client without async, behind the blocking feature.",{"title":76,"path":77,"stem":78,"description":768,"children":-1},"connect, attach, list and the Socket class of tauri-plugin-socketio-api.",1795285663243]