mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-20 17:02:18 +00:00
Expose test registry to docker
This commit is contained in:
parent
4629299d1a
commit
4a23be88c3
1 changed files with 3 additions and 3 deletions
|
|
@ -59,8 +59,8 @@ exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
fn serve_registry_once(document: Value) -> String {
|
fn serve_registry_once(document: Value) -> String {
|
||||||
let listener = TcpListener::bind("127.0.0.1:0").expect("bind registry server");
|
let listener = TcpListener::bind("0.0.0.0:0").expect("bind registry server");
|
||||||
let address = listener.local_addr().expect("registry address");
|
let port = listener.local_addr().expect("registry address").port();
|
||||||
let body = document.to_string();
|
let body = document.to_string();
|
||||||
|
|
||||||
std::thread::spawn(move || loop {
|
std::thread::spawn(move || loop {
|
||||||
|
|
@ -70,7 +70,7 @@ fn serve_registry_once(document: Value) -> String {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
format!("http://{address}/registry.json")
|
format!("http://127.0.0.1:{port}/registry.json")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn respond_json(stream: &mut TcpStream, body: &str) {
|
fn respond_json(stream: &mut TcpStream, body: &str) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue