fbi-proxy 1.9.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/release/fbi-proxy-linux-arm64 +0 -0
- package/release/fbi-proxy-linux-x64 +0 -0
- package/release/fbi-proxy-macos-arm64 +0 -0
- package/release/fbi-proxy-macos-x64 +0 -0
- package/release/fbi-proxy-windows-arm64.exe +0 -0
- package/release/fbi-proxy-windows-x64.exe +0 -0
- package/rs/fbi-proxy.rs +12 -6
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/rs/fbi-proxy.rs
CHANGED
|
@@ -384,7 +384,8 @@ npx fbi-proxy -d fbi.example.com # Only accept *.fbi.example.com</pre>
|
|
|
384
384
|
);
|
|
385
385
|
return Ok(Response::builder()
|
|
386
386
|
.status(StatusCode::BAD_GATEWAY)
|
|
387
|
-
.
|
|
387
|
+
.header("Content-Type", "text/plain")
|
|
388
|
+
.body(Full::new(Bytes::from(format!("502 Bad Gateway: failed to connect to {}: {}", tunnel_target, e))).map_err(|e| match e {}).boxed())?);
|
|
388
389
|
}
|
|
389
390
|
Err(_) => {
|
|
390
391
|
error!(
|
|
@@ -395,7 +396,8 @@ npx fbi-proxy -d fbi.example.com # Only accept *.fbi.example.com</pre>
|
|
|
395
396
|
);
|
|
396
397
|
return Ok(Response::builder()
|
|
397
398
|
.status(StatusCode::BAD_GATEWAY)
|
|
398
|
-
.
|
|
399
|
+
.header("Content-Type", "text/plain")
|
|
400
|
+
.body(Full::new(Bytes::from(format!("502 Bad Gateway: connection to {} timed out", tunnel_target))).map_err(|e| match e {}).boxed())?);
|
|
399
401
|
}
|
|
400
402
|
}
|
|
401
403
|
}
|
|
@@ -462,7 +464,8 @@ npx fbi-proxy -d fbi.example.com # Only accept *.fbi.example.com</pre>
|
|
|
462
464
|
);
|
|
463
465
|
Ok(Response::builder()
|
|
464
466
|
.status(StatusCode::BAD_GATEWAY)
|
|
465
|
-
.
|
|
467
|
+
.header("Content-Type", "text/plain")
|
|
468
|
+
.body(Full::new(Bytes::from(format!("502 Bad Gateway: failed to connect to {}: {}", target_host, e))).map_err(|e| match e {}).boxed())?)
|
|
466
469
|
}
|
|
467
470
|
Err(_) => {
|
|
468
471
|
error!(
|
|
@@ -474,7 +477,8 @@ npx fbi-proxy -d fbi.example.com # Only accept *.fbi.example.com</pre>
|
|
|
474
477
|
);
|
|
475
478
|
Ok(Response::builder()
|
|
476
479
|
.status(StatusCode::BAD_GATEWAY)
|
|
477
|
-
.
|
|
480
|
+
.header("Content-Type", "text/plain")
|
|
481
|
+
.body(Full::new(Bytes::from(format!("502 Bad Gateway: request to {} timed out", target_host))).map_err(|e| match e {}).boxed())?)
|
|
478
482
|
}
|
|
479
483
|
}
|
|
480
484
|
}
|
|
@@ -500,7 +504,8 @@ npx fbi-proxy -d fbi.example.com # Only accept *.fbi.example.com</pre>
|
|
|
500
504
|
error!("WS :ws:{} => :ws:{}{} 502 (upstream connection failed: {})", target_host, target_host, uri, e);
|
|
501
505
|
return Ok(Response::builder()
|
|
502
506
|
.status(StatusCode::BAD_GATEWAY)
|
|
503
|
-
.
|
|
507
|
+
.header("Content-Type", "text/plain")
|
|
508
|
+
.body(Full::new(Bytes::from(format!("502 Bad Gateway: WebSocket upstream {} unavailable: {}", target_host, e))).map_err(|e| match e {}).boxed())?);
|
|
504
509
|
}
|
|
505
510
|
};
|
|
506
511
|
|
|
@@ -578,7 +583,8 @@ async fn handle_connection(
|
|
|
578
583
|
error!("Request handling error: {}", e);
|
|
579
584
|
Ok(Response::builder()
|
|
580
585
|
.status(StatusCode::INTERNAL_SERVER_ERROR)
|
|
581
|
-
.
|
|
586
|
+
.header("Content-Type", "text/plain")
|
|
587
|
+
.body(Full::new(Bytes::from(format!("500 Internal Server Error: {}", e))).map_err(|e| match e {}).boxed())
|
|
582
588
|
.unwrap())
|
|
583
589
|
}
|
|
584
590
|
}
|