File tree Expand file tree Collapse file tree 3 files changed +4
-12
lines changed Expand file tree Collapse file tree 3 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ pub fn AutoReload(
27
27
None => options. reload_port ,
28
28
} ;
29
29
let protocol = match options. reload_ws_protocol {
30
- leptos_config:: ReloadWSProtocol :: Auto => "null" ,
31
30
leptos_config:: ReloadWSProtocol :: WS => "'ws://'" ,
32
31
leptos_config:: ReloadWSProtocol :: WSS => "'wss://'" ,
33
32
} ;
Original file line number Diff line number Diff line change 1
1
let host = window . location . hostname ;
2
-
3
- if ( protocol === null ) {
4
- protocol = window . location . protocol === 'https:' ? 'wss://' : 'ws://' ;
5
- }
6
-
7
2
let ws = new WebSocket ( `${ protocol } ${ host } :${ reload_port } /live_reload` ) ;
8
3
ws . onmessage = ( ev ) => {
9
4
let msg = JSON . parse ( ev . data ) ;
Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ impl LeptosOptions {
153
153
None => None ,
154
154
} ,
155
155
reload_ws_protocol : ws_from_str (
156
- env_w_default ( "LEPTOS_RELOAD_WS_PROTOCOL" , "auto " ) ?. as_str ( ) ,
156
+ env_w_default ( "LEPTOS_RELOAD_WS_PROTOCOL" , "ws " ) ?. as_str ( ) ,
157
157
) ?,
158
158
not_found_path : env_w_default ( "LEPTOS_NOT_FOUND_PATH" , "/404" ) ?
159
159
. into ( ) ,
@@ -283,24 +283,22 @@ impl TryFrom<String> for Env {
283
283
pub enum ReloadWSProtocol {
284
284
WS ,
285
285
WSS ,
286
- Auto ,
287
286
}
288
287
289
288
impl Default for ReloadWSProtocol {
290
289
fn default ( ) -> Self {
291
- Self :: Auto
290
+ Self :: WS
292
291
}
293
292
}
294
293
295
294
fn ws_from_str ( input : & str ) -> Result < ReloadWSProtocol , LeptosConfigError > {
296
295
let sanitized = input. to_lowercase ( ) ;
297
296
match sanitized. as_ref ( ) {
298
- "auto" => Ok ( ReloadWSProtocol :: Auto ) ,
299
297
"ws" | "WS" => Ok ( ReloadWSProtocol :: WS ) ,
300
298
"wss" | "WSS" => Ok ( ReloadWSProtocol :: WSS ) ,
301
299
_ => Err ( LeptosConfigError :: EnvVarError ( format ! (
302
- "{input} is not a supported websocket protocol. Use only `auto`, \
303
- `ws` or ` wss`.",
300
+ "{input} is not a supported websocket protocol. Use only `ws` or \
301
+ `wss`.",
304
302
) ) ) ,
305
303
}
306
304
}
You can’t perform that action at this time.
0 commit comments