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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fbi-proxy",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "FBI-Proxy provides easy HTTPS access to your local services with intelligent domain routing",
5
5
  "keywords": [
6
6
  "development-tools",
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
- .body(Full::new(Bytes::from("FBIPROXY CONNECT ERROR")).map_err(|e| match e {}).boxed())?);
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
- .body(Full::new(Bytes::from("FBIPROXY CONNECT TIMEOUT")).map_err(|e| match e {}).boxed())?);
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
- .body(Full::new(Bytes::from("FBIPROXY ERROR")).map_err(|e| match e {}).boxed())?)
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
- .body(Full::new(Bytes::from("FBIPROXY TIMEOUT")).map_err(|e| match e {}).boxed())?)
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
- .body(Full::new(Bytes::from("WebSocket upstream unavailable")).map_err(|e| match e {}).boxed())?);
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
- .body(Full::new(Bytes::from("Internal Server Error")).map_err(|e| match e {}).boxed())
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
  }