[{"data":1,"prerenderedAt":573},["ShallowReactive",2],{"navigation":3,"\u002Ftauri\u002Fsecurity":129,"\u002Ftauri\u002Fsecurity-surround":568},[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":88,"body":131,"description":561,"extension":562,"links":563,"meta":564,"navigation":565,"path":89,"seo":566,"stem":90,"__hash__":567},"docs\u002F3.tauri\u002F5.security.md",{"type":132,"value":133,"toc":552},"minimark",[134,139,176,258,262,292,296,306,401,439,455,459,495,498,505,509,533,537,548],[135,136,138],"h2",{"id":137},"reserve-rusts-ids","Reserve Rust's ids",[140,141,142,143,147,148,151,152,155,156,159,160,163,164,167,168,171,172,175],"p",{},"Rust usually registers its clients after an ",[144,145,146],"code",{},"await"," (the connect). Until then any page script with ",[144,149,150],{},"allow-connect"," could ",[144,153,154],{},"connect"," under the same id, and Rust's ",[144,157,158],{},"insert"," would fail with ",[144,161,162],{},"AlreadyExists"," while ",[144,165,166],{},"get(id)"," returned the page's client. Call ",[144,169,170],{},"reserve(id)"," in ",[144,173,174],{},"setup",", synchronously:",[177,178,183],"pre",{"className":179,"code":180,"language":181,"meta":182,"style":182},"language-rust shiki shiki-themes material-theme-lighter material-theme material-theme-palenight",".setup(|app| {\n    app.socketio().reserve(\"core\");\n    Ok(())\n})\n","rust","",[144,184,185,210,242,252],{"__ignoreMap":182},[186,187,190,194,197,200,204,207],"span",{"class":188,"line":189},"line",1,[186,191,193],{"class":192},"sMK4o",".",[186,195,174],{"class":196},"s2Zo4",[186,198,199],{"class":192},"(|",[186,201,203],{"class":202},"sTEyZ","app",[186,205,206],{"class":192},"|",[186,208,209],{"class":192}," {\n",[186,211,213,216,218,221,224,227,230,233,237,239],{"class":188,"line":212},2,[186,214,215],{"class":202},"    app",[186,217,193],{"class":192},[186,219,220],{"class":196},"socketio",[186,222,223],{"class":192},"().",[186,225,226],{"class":196},"reserve",[186,228,229],{"class":192},"(",[186,231,232],{"class":192},"\"",[186,234,236],{"class":235},"sfazB","core",[186,238,232],{"class":192},[186,240,241],{"class":192},");\n",[186,243,245,249],{"class":188,"line":244},3,[186,246,248],{"class":247},"sBMFI","    Ok",[186,250,251],{"class":192},"(())\n",[186,253,255],{"class":188,"line":254},4,[186,256,257],{"class":192},"})\n",[135,259,261],{"id":260},"read-only-clients","Read-only clients",[140,263,264,265,268,269,272,273,272,276,279,280,283,284,287,288,193],{},"Register clients the webview must not drive with ",[144,266,267],{},"Access::ReadOnly",": ",[144,270,271],{},"emit",", ",[144,274,275],{},"emitWithAck",[144,277,278],{},"ack"," and ",[144,281,282],{},"disconnect"," are refused from every webview with ",[144,285,286],{},"AccessDenied",", whatever the capabilities allow. See ",[289,290,80],"a",{"href":291},"\u002Ftauri\u002Frust-api#read-only-clients",[135,293,295],{"id":294},"url-allow-list","URL allow-list",[140,297,298,299,302,303,305],{},"The sockets run in Rust, so the webview's CSP (",[144,300,301],{},"connect-src",") does not limit them: with ",[144,304,150],{}," a page can reach any host with any headers. Restrict it:",[177,307,309],{"className":179,"code":308,"language":181,"meta":182,"style":182},".plugin(\n    tauri_plugin_socketio::Builder::new()\n        .allow_url_prefix(\"https:\u002F\u002Fapi.example.com\")       \u002F\u002F scheme + host + port\n        .allow_url_prefix(\"wss:\u002F\u002Frt.example.com\u002Fv1\u002F\")      \u002F\u002F ... and a path prefix\n        .build(),\n)\n",[144,310,311,321,340,364,384,395],{"__ignoreMap":182},[186,312,313,315,318],{"class":188,"line":189},[186,314,193],{"class":192},[186,316,317],{"class":196},"plugin",[186,319,320],{"class":192},"(\n",[186,322,323,326,329,332,334,337],{"class":188,"line":212},[186,324,325],{"class":247},"    tauri_plugin_socketio",[186,327,328],{"class":192},"::",[186,330,331],{"class":247},"Builder",[186,333,328],{"class":192},[186,335,336],{"class":196},"new",[186,338,339],{"class":192},"()\n",[186,341,342,345,348,350,352,355,357,360],{"class":188,"line":244},[186,343,344],{"class":192},"        .",[186,346,347],{"class":196},"allow_url_prefix",[186,349,229],{"class":192},[186,351,232],{"class":192},[186,353,354],{"class":235},"https:\u002F\u002Fapi.example.com",[186,356,232],{"class":192},[186,358,359],{"class":192},")",[186,361,363],{"class":362},"sHwdD","       \u002F\u002F scheme + host + port\n",[186,365,366,368,370,372,374,377,379,381],{"class":188,"line":254},[186,367,344],{"class":192},[186,369,347],{"class":196},[186,371,229],{"class":192},[186,373,232],{"class":192},[186,375,376],{"class":235},"wss:\u002F\u002Frt.example.com\u002Fv1\u002F",[186,378,232],{"class":192},[186,380,359],{"class":192},[186,382,383],{"class":362},"      \u002F\u002F ... and a path prefix\n",[186,385,387,389,392],{"class":188,"line":386},5,[186,388,344],{"class":192},[186,390,391],{"class":196},"build",[186,393,394],{"class":192},"(),\n",[186,396,398],{"class":188,"line":397},6,[186,399,400],{"class":192},")\n",[140,402,403,404,408,409,412,413,416,417,420,421,424,425,272,428,431,432,435,436,193],{},"What is enforced: the scheme, the host, the port, and the ",[405,406,407],"strong",{},"engine.io path"," (the ",[144,410,411],{},"path"," option, default ",[144,414,415],{},"\u002Fsocket.io\u002F",") under the prefix's path on a ",[144,418,419],{},"\u002F"," boundary. The URL's own path is the namespace and is not part of the check, nor is the ",[144,422,423],{},"namespace"," option. Query and headers changed later (",[144,426,427],{},"setQuery",[144,429,430],{},"setHeaders",") and ",[144,433,434],{},"reconnect"," cannot move the target. A refused URL rejects with ",[144,437,438],{},"UrlNotAllowed",[140,440,441,442,444,445,448,449,451,452,454],{},"Without ",[144,443,347],{}," every URL is allowed (",[144,446,447],{},"init()","). Rust's ",[144,450,154],{}," \u002F ",[144,453,158],{}," are never restricted.",[135,456,458],{"id":457},"headers","Headers",[140,460,461,462,272,465,272,468,272,471,272,474,272,477,480,481,279,484,487,488,491,492,494],{},"Headers from the webview are limited: ",[144,463,464],{},"Host",[144,466,467],{},"Connection",[144,469,470],{},"Upgrade",[144,472,473],{},"Content-Length",[144,475,476],{},"Transfer-Encoding",[144,478,479],{},"Cookie"," (cookies come from the jar), ",[144,482,483],{},"Sec-WebSocket-*",[144,485,486],{},"Proxy-*"," are refused with ",[144,489,490],{},"InvalidOptions"," naming the header, in the connect options and in ",[144,493,430],{},". Rust's clients are not limited.",[135,496,50],{"id":497},"tls",[140,499,500,501,504],{},"The ",[144,502,503],{},"ca"," option adds trusted certificates for a private CA; there is no option to turn certificate checks off.",[135,506,508],{"id":507},"webview-isolation","Webview isolation",[140,510,511,279,514,516,517,520,521,524,525,528,529,532],{},[144,512,513],{},"unsubscribe",[144,515,278],{}," act only on the calling webview's subscriptions and on acks offered to it (",[144,518,519],{},"UnknownAck"," otherwise). A webview has at most ",[144,522,523],{},"MAX_SUBSCRIPTIONS_PER_WEBVIEW"," (64) subscriptions (",[144,526,527],{},"TooManySubscriptions",") and, per client, at most ",[144,530,531],{},"MAX_PENDING_ACKS_PER_WEBVIEW"," (256) unanswered server acks; past that its own oldest ack is forgotten, never another webview's.",[135,534,536],{"id":535},"least-privilege","Least privilege",[140,538,539,540,543,544,547],{},"Grant ",[144,541,542],{},"socketio:allow-read"," instead of ",[144,545,546],{},"socketio:default"," to windows that only observe.",[549,550,551],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}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 pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}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}",{"title":182,"searchDepth":212,"depth":244,"links":553},[554,555,556,557,558,559,560],{"id":137,"depth":212,"text":138},{"id":260,"depth":212,"text":261},{"id":294,"depth":212,"text":295},{"id":457,"depth":212,"text":458},{"id":497,"depth":212,"text":50},{"id":507,"depth":212,"text":508},{"id":535,"depth":212,"text":536},"Reserved ids, read-only clients, the URL allow-list, refused headers and webview isolation.","md",null,{},true,{"title":88,"description":561},"nmupkYjThjHaDuDAxzzJY5a7grn8Hzag52c8LRixR2k",[569,571],{"title":84,"path":85,"stem":86,"description":570,"children":-1},"The default and allow-read sets and one permission per command.",{"title":92,"path":93,"stem":94,"description":572,"children":-1},"What a subscription's channel carries, the state objects, ack rules and SocketIoError kinds.",1795285664033]