mirror of
https://github.com/openai/codex.git
synced 2026-05-15 16:53:05 +00:00
## Why `codex exec-server` should keep the existing public `ws://IP:PORT` URL shape while serving that websocket connection through an HTTP upgrade path internally. That keeps the client-facing configuration simple and allows the listener to work through intermediate HTTP-aware infrastructure. ## What changed - keep the emitted and configured exec-server URL as `ws://IP:PORT` - serve that websocket endpoint through Axum HTTP upgrade handling on `/` - expose `GET /readyz` from the same listener for readiness checks - route upgraded Axum websocket streams through the shared JSON-RPC connection machinery - initialize the rustls crypto provider before websocket client connections - preserve inbound binary websocket JSON-RPC parsing for compatibility with the prior transport behavior ## Verification - `cargo test -p codex-exec-server --test health --test process --test websocket --test initialize --test exec_process`
22 lines
619 B
Rust
22 lines
619 B
Rust
#![cfg(unix)]
|
|
|
|
mod common;
|
|
|
|
use common::exec_server::exec_server;
|
|
use pretty_assertions::assert_eq;
|
|
|
|
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
|
async fn exec_server_serves_readyz_alongside_websocket_endpoint() -> anyhow::Result<()> {
|
|
let mut server = exec_server().await?;
|
|
let http_base_url = server
|
|
.websocket_url()
|
|
.strip_prefix("ws://")
|
|
.expect("websocket URL should use ws://");
|
|
|
|
let response = reqwest::get(format!("http://{http_base_url}/readyz")).await?;
|
|
assert_eq!(response.status(), reqwest::StatusCode::OK);
|
|
|
|
server.shutdown().await?;
|
|
Ok(())
|
|
}
|