Skip to content

Failed to listen on 127.0.0.1 with tokio #538

Closed
@CfirTsabari

Description

@CfirTsabari

when using tide with tokio.

#[tokio::main]
async fn main() -> Result<(), std::io::Error> {
    let mut app = tide::new();
    app.at("/").get(|_| async { Ok("Hello, world!") });
    app.listen("127.0.0.1:8090").await?;
    Ok(())
}

and when trying to access it I get the connection stuck

❯ curl http://127.0.0.1:8090/

working with async-std solve the problem,
listening to localhost instead of 127.0.0.1 should also solve this

[dependencies]
tokio = { version = "0.2", features = ["full"] }
tide = "0.8.0"
❯ cargo --version
cargo 1.43.0 (2cbe9048e 2020-05-03)
❯ rustc --version
rustc 1.43.1 (8d69840ab 2020-05-04)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions