Skip to content

Commit 2afde7b

Browse files
committed
Change default socket addresses to localhost
1 parent 187c1fd commit 2afde7b

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ cargo run -- [OPTIONS]
1818
- `--builder-url <URL>`: URL of the builder execution engine (required)
1919
- `--builder-jwt-token <TOKEN>`: JWT token for builder authentication (required)
2020
- `--builder-jwt-path <PATH>`: Path to the builder JWT secret file (required if `--builder-jwt-token` is not provided)
21-
- `--rpc-host <HOST>`: Host to run the server on (default: 0.0.0.0)
21+
- `--rpc-host <HOST>`: Host to run the server on (default: 127.0.0.1)
2222
- `--rpc-port <PORT>`: Port to run the server on (default: 8081)
2323
- `--tracing`: Enable tracing (default: false)
2424
- `--log-level <LEVEL>`: Log level (default: info)
2525
- `--log-format <FORMAT>`: Log format (default: text)
2626
- `--metrics`: Enable metrics (default: false)
27+
- `--metrics-host <METRICS_HOST>`: Host to run the metrics server on (default: 127.0.0.1)
2728
- `--debug-host <HOST>`: Host to run the server on (default: 127.0.0.1)
2829
- `--debug-server-port <PORT>`: Port to run the debug server on (default: 5555)
2930

src/cli.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub struct Args {
3636
pub max_unsafe_interval: u64,
3737

3838
/// Host to run the server on
39-
#[arg(long, env, default_value = "0.0.0.0")]
39+
#[arg(long, env, default_value = "127.0.0.1")]
4040
pub rpc_host: String,
4141

4242
/// Port to run the server on
@@ -52,7 +52,7 @@ pub struct Args {
5252
pub metrics: bool,
5353

5454
/// Host to run the metrics server on
55-
#[arg(long, env, default_value = "0.0.0.0")]
55+
#[arg(long, env, default_value = "127.0.0.1")]
5656
pub metrics_host: String,
5757

5858
/// Port to run the metrics server on

src/client/rpc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ pub mod tests {
395395

396396
use super::*;
397397

398-
const AUTH_ADDR: &str = "0.0.0.0";
398+
const AUTH_ADDR: &str = "127.0.0.1";
399399
const SECRET: &str = "f79ae8046bc11c9927afe911db7143c51a806c4a537cc08e0d37140b0192f430";
400400

401401
pub fn get_available_port() -> u16 {

src/health.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ mod tests {
101101
+ 'static,
102102
{
103103
{
104-
let listener = TcpListener::bind("0.0.0.0:0").await?;
104+
let listener = TcpListener::bind("127.0.0.1:0").await?;
105105
let addr = listener.local_addr()?;
106106

107107
let handle = tokio::spawn(async move {

src/proxy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ mod tests {
206206
// None,
207207
));
208208

209-
let temp_listener = TcpListener::bind("0.0.0.0:0").await?;
209+
let temp_listener = TcpListener::bind("127.0.0.1:0").await?;
210210
let server_addr = temp_listener.local_addr()?;
211211
drop(temp_listener);
212212

@@ -247,7 +247,7 @@ mod tests {
247247

248248
impl MockHttpServer {
249249
async fn serve() -> eyre::Result<Self> {
250-
let listener = TcpListener::bind("0.0.0.0:0").await?;
250+
let listener = TcpListener::bind("127.0.0.1:0").await?;
251251
let addr = listener.local_addr()?;
252252
let requests = Arc::new(Mutex::new(vec![]));
253253

src/server.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -694,12 +694,12 @@ mod tests {
694694
use std::sync::Arc;
695695
use tokio::time::sleep;
696696

697-
const HOST: &str = "0.0.0.0";
697+
const HOST: &str = "127.0.0.1";
698698
const L2_PORT: u16 = 8545;
699699
const L2_ADDR: &str = "127.0.0.1:8545";
700700
const BUILDER_PORT: u16 = 8544;
701701
const BUILDER_ADDR: &str = "127.0.0.1:8544";
702-
const SERVER_ADDR: &str = "0.0.0.0:8556";
702+
const SERVER_ADDR: &str = "127.0.0.1:8556";
703703

704704
#[derive(Debug, Clone)]
705705
pub struct MockEngineServer {
@@ -815,7 +815,7 @@ mod tests {
815815

816816
let server = Server::builder()
817817
.set_http_middleware(http_middleware)
818-
.build("0.0.0.0:8556".parse::<SocketAddr>().unwrap())
818+
.build("127.0.0.1:8556".parse::<SocketAddr>().unwrap())
819819
.await
820820
.unwrap()
821821
.start(module);

0 commit comments

Comments
 (0)