Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stdlib/src/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ impl StdlibRegistry {
}
SERVER_RUNNING.store(true, Ordering::SeqCst);
let server =
Mutex::new(tiny_http::Server::http(format!("0.0.0.0:{}", port)).unwrap());
Mutex::new(tiny_http::Server::http(format!("127.0.0.1:{}", port)).unwrap());
thread::spawn(move || {
while SERVER_RUNNING.load(Ordering::SeqCst) {
if let Ok(mut req) = server.lock().unwrap().recv() {
Expand Down Expand Up @@ -471,7 +471,7 @@ impl StdlibRegistry {
}
SERVER_RUNNING.store(true, Ordering::SeqCst);
let server =
Mutex::new(tiny_http::Server::http(format!("0.0.0.0:{}", port)).unwrap());
Mutex::new(tiny_http::Server::http(format!("127.0.0.1:{}", port)).unwrap());
thread::spawn(move || {
while SERVER_RUNNING.load(Ordering::SeqCst) {
if let Ok(mut req) = server.lock().unwrap().recv() {
Expand Down
2 changes: 1 addition & 1 deletion stdlib/tests/stdlib_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ fn test_web_module() {

// Bind a listener to a random port to ensure the port is taken
// Keep it alive to conflict
let listener = TcpListener::bind("0.0.0.0:0").unwrap();
let listener = TcpListener::bind("127.0.0.1:0").unwrap();
let port = listener.local_addr().unwrap().port();

// Test panic on `start` when port is in use
Expand Down
Loading