docs: remove zigbuild references and update just commands, fix: remove Content-Length formatting causing parse errors
This commit is contained in:
1 parent
f59602a3e2
commit
4c8e2f6414
3 files changed
+89
-23
No files matched your search
+19
-2
@@ -56,6 +56,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
.replace("https://", "wss://");
|
||||
let ws_url = format!("{ws_url}/ws?client=proxy");
|
||||
|
||||
let mut retry_count = 0;
|
||||
loop {
|
||||
if shutdown_rx.try_recv().is_ok() {
|
||||
tracing::info!("Stub shutdown requested");
|
||||
@@ -87,6 +88,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
match connect_result {
|
||||
Ok(Ok((ws_stream, _))) => {
|
||||
retry_count = 0;
|
||||
tracing::info!("Successfully connected to target server");
|
||||
let (mut write, mut read) = ws_stream.split();
|
||||
|
||||
@@ -125,8 +127,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
);
|
||||
use tokio::io::AsyncWriteExt;
|
||||
let mut stdout = tokio::io::stdout();
|
||||
let _ = stdout.write_all(text.as_bytes()).await;
|
||||
let _ = stdout.write_all(b"\n").await;
|
||||
let response = format!("{}\n", text);
|
||||
let _ = stdout.write_all(response.as_bytes()).await;
|
||||
let _ = stdout.flush().await;
|
||||
}
|
||||
}
|
||||
@@ -153,14 +155,29 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
}
|
||||
Ok(Err(e)) => {
|
||||
tracing::error!("Failed to connect via WSS: {}", e);
|
||||
retry_count += 1;
|
||||
if retry_count >= 5 {
|
||||
tracing::error!("Max connection retries reached. Exiting proxy.");
|
||||
break;
|
||||
}
|
||||
tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;
|
||||
}
|
||||
Err(_) => {
|
||||
tracing::error!("Connection attempt timed out");
|
||||
retry_count += 1;
|
||||
if retry_count >= 5 {
|
||||
tracing::error!("Max connection retries reached. Exiting proxy.");
|
||||
break;
|
||||
}
|
||||
tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if retry_count >= 5 {
|
||||
return Err("Failed to connect to the MCP memory server after multiple attempts. Is it running?".into());
|
||||
}
|
||||
|
||||
Ok(())
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user