Skip to content

Commit

Permalink
fix!: replace all ipv4 addresses by localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
jost-s committed Apr 16, 2024
1 parent fe861fc commit 28ae7e8
Show file tree
Hide file tree
Showing 8 changed files with 223 additions and 229 deletions.
283 changes: 145 additions & 138 deletions Cargo.lock

Large diffs are not rendered by default.

19 changes: 12 additions & 7 deletions crates/trycp_server/src/admin_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub(crate) async fn admin_call(id: String, message: Vec<u8>) -> Result<Vec<u8>,
.map(|player| player.admin_port)
.context(PlayerNotConfigured { id })?;

let addr = format!("127.0.0.1:{port}");
let addr = format!("localhost:{port}");
let stream = tokio::net::TcpStream::connect(addr.clone())
.await
.context(TcpConnect)?;
Expand Down Expand Up @@ -114,21 +114,26 @@ async fn call(
.context(NoResponse)?
.context(ReceiveResponse)?;
match ws_message {
Message::Close(_) => {
return Err(CallError::NoResponse)
}
Message::Close(_) => return Err(CallError::NoResponse),
Message::Binary(ws_data) => {
return Ok(ws_data);
}
Message::Ping(p) => {
ws_stream.send(Message::Pong(p)).await.context(SendRequest)?;
ws_stream
.send(Message::Pong(p))
.await
.context(SendRequest)?;
}
_ => {
return Err(CallError::UnexpectedResponseType { response: ws_message });
return Err(CallError::UnexpectedResponseType {
response: ws_message,
});
}
}
}
}).await.context(ResponseTimeout)??;
})
.await
.context(ResponseTimeout)??;

let message: HolochainMessage = rmp_serde::from_slice(&ws_data)
.with_context(|| DeserializeResponse { response: ws_data })?;
Expand Down
2 changes: 1 addition & 1 deletion crates/trycp_server/src/app_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub(crate) async fn connect(
return Ok(());
}

let addr = format!("127.0.0.1:{port}");
let addr = format!("localhost:{port}");
let stream = tokio::net::TcpStream::connect(addr.clone())
.await
.context(TcpConnect)?;
Expand Down
38 changes: 19 additions & 19 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

98 changes: 40 additions & 58 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@holochain/tryorama",
"description": "Toolset to manage Holochain conductors and facilitate running test scenarios",
"version": "0.16.0-dev.2",
"version": "0.16.0-dev.3",
"author": "Holochain Foundation",
"license": "MIT",
"keywords": [
Expand Down Expand Up @@ -42,7 +42,7 @@
"prepublishOnly": "npm run build"
},
"dependencies": {
"@holochain/client": "^0.17.0-dev.8",
"@holochain/client": "^0.17.0-dev.9",
"get-port": "^6.1.2",
"lodash": "^4.17.21",
"uuid": "^8.3.2",
Expand Down
2 changes: 1 addition & 1 deletion ts/src/local/conductor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { _ALLOWED_ORIGIN } from "../common.js";

const logger = makeLogger("Local Conductor");

const HOST_URL = new URL("ws://127.0.0.1");
const HOST_URL = new URL("ws://localhost");
const DEFAULT_TIMEOUT = 60000;
const LAIR_PASSWORD = "lair-password";

Expand Down
Loading

0 comments on commit 28ae7e8

Please sign in to comment.