[{"data":1,"prerenderedAt":539},["ShallowReactive",2],{"navigation":3,"\u002Fclient\u002Ftransports-and-proxies":129,"\u002Fclient\u002Ftransports-and-proxies-surround":534},[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":46,"body":131,"description":528,"extension":529,"links":530,"meta":531,"navigation":183,"path":47,"seo":532,"stem":48,"__hash__":533},"docs\u002F2.client\u002F4.transports-and-proxies.md",{"type":132,"value":133,"toc":521},"minimark",[134,139,262,359,370,374,377,429,448,451,468,482,486,493,497,504,507,517],[135,136,138],"h2",{"id":137},"transports","Transports",[140,141,146],"pre",{"className":142,"code":143,"language":144,"meta":145,"style":145},"language-rust shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","use socketio_next::{ClientBuilder, TransportType};\n\nlet client = ClientBuilder::new(url)\n    .transport_type(TransportType::Websocket)\n    .connect()\n    .await?;\n","rust","",[147,148,149,178,185,218,239,250],"code",{"__ignoreMap":145},[150,151,154,158,162,166,169,172,175],"span",{"class":152,"line":153},"line",1,[150,155,157],{"class":156},"sbssI","use",[150,159,161],{"class":160},"sBMFI"," socketio_next",[150,163,165],{"class":164},"sMK4o","::{",[150,167,168],{"class":160},"ClientBuilder",[150,170,171],{"class":164},",",[150,173,174],{"class":160}," TransportType",[150,176,177],{"class":164},"};\n",[150,179,181],{"class":152,"line":180},2,[150,182,184],{"emptyLinePlaceholder":183},true,"\n",[150,186,188,192,196,199,202,205,209,212,215],{"class":152,"line":187},3,[150,189,191],{"class":190},"spNyl","let",[150,193,195],{"class":194},"sTEyZ"," client ",[150,197,198],{"class":164},"=",[150,200,201],{"class":160}," ClientBuilder",[150,203,204],{"class":164},"::",[150,206,208],{"class":207},"s2Zo4","new",[150,210,211],{"class":164},"(",[150,213,214],{"class":194},"url",[150,216,217],{"class":164},")\n",[150,219,221,224,227,229,232,234,237],{"class":152,"line":220},4,[150,222,223],{"class":164},"    .",[150,225,226],{"class":207},"transport_type",[150,228,211],{"class":164},[150,230,231],{"class":160},"TransportType",[150,233,204],{"class":164},[150,235,236],{"class":160},"Websocket",[150,238,217],{"class":164},[150,240,242,244,247],{"class":152,"line":241},5,[150,243,223],{"class":164},[150,245,246],{"class":207},"connect",[150,248,249],{"class":164},"()\n",[150,251,253,255,259],{"class":152,"line":252},6,[150,254,223],{"class":164},[150,256,258],{"class":257},"s7zQu","await",[150,260,261],{"class":164},"?;\n",[263,264,265,284],"table",{},[266,267,268],"thead",{},[269,270,271,276,281],"tr",{},[272,273,274],"th",{},[147,275,231],{},[272,277,278,279],{},"socket.io-client ",[147,280,137],{},[272,282,283],{},"What",[285,286,287,304,319,333],"tbody",{},[269,288,289,296,301],{},[290,291,292,295],"td",{},[147,293,294],{},"Any"," (default)",[290,297,298],{},[147,299,300],{},"[\"polling\", \"websocket\"]",[290,302,303],{},"polling, upgraded to websocket when the server offers it; stays on polling when the upgrade fails",[269,305,306,311,316],{},[290,307,308],{},[147,309,310],{},"Polling",[290,312,313],{},[147,314,315],{},"[\"polling\"]",[290,317,318],{},"long-polling only, never tries the websocket",[269,320,321,325,330],{},[290,322,323],{},[147,324,236],{},[290,326,327],{},[147,328,329],{},"[\"websocket\"]",[290,331,332],{},"websocket from the start",[269,334,335,340,343],{},[290,336,337],{},[147,338,339],{},"WebsocketUpgrade",[290,341,342],{},"—",[290,344,345,346,350,351,354,355,358],{},"polling, then the upgrade ",[347,348,349],"strong",{},"must"," succeed (",[147,352,353],{},"UpgradeUnavailable"," \u002F ",[147,356,357],{},"UpgradeFailed"," otherwise)",[360,361,362,363,365,366,369],"p",{},"The polling and websocket handshakes are bounded by the timeout; a blackholed websocket falls back to polling with ",[147,364,294],{},". ",[147,367,368],{},"link_info().transport"," shows the transport in use.",[135,371,373],{"id":372},"proxies","Proxies",[360,375,376],{},"Polling requests and the websocket go through the same HTTP proxy:",[378,379,380,388,423],"ul",{},[381,382,383,384,387],"li",{},"the one given to ",[147,385,386],{},"proxy(\"http:\u002F\u002Fuser:pass@host:port\")",";",[381,389,390,391,394,395,354,398,401,402,394,405,354,408,401,411,414,415,418,419,422],{},"else the environment's: ",[147,392,393],{},"HTTPS_PROXY"," for ",[147,396,397],{},"https",[147,399,400],{},"wss",", ",[147,403,404],{},"HTTP_PROXY",[147,406,407],{},"http",[147,409,410],{},"ws",[147,412,413],{},"ALL_PROXY",", minus ",[147,416,417],{},"NO_PROXY"," (domains, IPs, CIDR and ",[147,420,421],{},"*",");",[381,424,425,428],{},[147,426,427],{},"no_proxy()"," turns proxies off for both transports.",[360,430,431,432,435,436,439,440,443,444,447],{},"The websocket uses a ",[147,433,434],{},"CONNECT"," tunnel with basic auth from the proxy URL's user info. Both transports take the same decision (the websocket uses the matcher reqwest uses for polling). Only ",[147,437,438],{},"http:\u002F\u002F"," proxies are spoken for the websocket: an ",[147,441,442],{},"https:\u002F\u002F"," or SOCKS proxy is a ",[147,445,446],{},"ProxyFailed"," error, never a silent direct connection.",[360,449,450],{},"The environment is read once, when the client is built, and that decision holds for its life.",[452,453,454],"note",{},[360,455,456,457,460,461,464,465,467],{},"If a crate in your build enables reqwest's ",[147,458,459],{},"system-proxy"," feature (macOS \u002F Windows system settings), only polling sees those settings. Call ",[147,462,463],{},"proxy(..)"," or ",[147,466,427],{}," to make both transports agree.",[360,469,470,471,474,475,477,478,481],{},"Environment proxies apply to ",[147,472,473],{},"ws:\u002F\u002F"," too: a proxy that only allows ",[147,476,434],{}," to port 443 then refuses the websocket, and with ",[147,479,480],{},"TransportType::Any"," the client stays on polling.",[135,483,485],{"id":484},"redirects","Redirects",[360,487,488,489,492],{},"Redirects are never followed (engine.io does not use them): a 3xx is an ",[147,490,491],{},"HttpStatus"," error.",[135,494,496],{"id":495},"one-http-client-per-client","One HTTP client per client",[360,498,499,500,503],{},"The handshake, the polls and the POSTs of one client share one reqwest client (its connection pool and, with the ",[147,501,502],{},"cookies"," feature, its cookie jar) across reconnects. Long-poll GETs fail after pingInterval + pingTimeout; POSTs have no total bound, so a large upload is not cut by the heartbeat.",[135,505,506],{"id":502},"Cookies",[360,508,509,510,512,513,516],{},"With the ",[147,511,502],{}," feature each client has a cookie jar: cookies set by polling answers go back on later requests and on the websocket handshake. Load balancers that pin sessions by cookie (sticky sessions) need it; without it a reconnect may land on a node that does not know the session (",[147,514,515],{},"HttpStatus { status: 400, message: \"Session ID unknown\" }",").",[518,519,520],"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 .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":145,"searchDepth":180,"depth":187,"links":522},[523,524,525,526,527],{"id":137,"depth":180,"text":138},{"id":372,"depth":180,"text":373},{"id":484,"depth":180,"text":485},{"id":495,"depth":180,"text":496},{"id":502,"depth":180,"text":506},"Polling, websocket and upgrade; HTTP proxies from the builder or the environment; the shared HTTP client.","md",null,{},{"title":46,"description":528},"swg9_jMxnzm_Ov8F8qcpBKtiqUk9QgKZVlc5Q_YOofM",[535,537],{"title":42,"path":43,"stem":44,"description":536,"children":-1},"ConnectionState, DisconnectReason, LinkInfo, the heartbeat, reconnect() and shutdown.",{"title":50,"path":51,"stem":52,"description":538,"children":-1},"rustls or native-tls, private CAs, the operating system's trust store.",1795285663246]