Giter Club home page Giter Club logo

Comments (4)

thisisclint21 avatar thisisclint21 commented on August 15, 2024

Works no me!

endpoint: format!("127.0.0.1:7021"),

from nickel.rs.

Ragueel avatar Ragueel commented on August 15, 2024

I did with Wi-Fi turned off:

let mut server = Nickel::new();
server.listen("127.0.0.1:5010");

And it throws this error when : cargo run

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: InitializationError(Some("Error opening a connection: Error communicating with the server: 
A socket operation was attempted to an unreachable host. (os error 10065)"))', src\libcore\result.rs:1165:5
stack backtrace:
   0: backtrace::backtrace::trace_unsynchronized
             at C:\Users\VssAdministrator\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.37\src\backtrace\mod.rs:66
   1: std::sys_common::backtrace::_print_fmt
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\/src\libstd\sys_common\backtrace.rs:76
   2: std::sys_common::backtrace::_print::{{impl}}::fmt
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\/src\libstd\sys_common\backtrace.rs:60
   3: core::fmt::write
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\/src\libcore\fmt\mod.rs:1028
   4: std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\/src\libstd\io\mod.rs:1412
   5: std::sys_common::backtrace::_print
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\/src\libstd\sys_common\backtrace.rs:64
   6: std::sys_common::backtrace::print
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\/src\libstd\sys_common\backtrace.rs:49
   7: std::panicking::default_hook::{{closure}}
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\/src\libstd\panicking.rs:196
   8: std::panicking::default_hook
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\/src\libstd\panicking.rs:210
   9: std::panicking::rust_panic_with_hook
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\/src\libstd\panicking.rs:473
  10: std::panicking::continue_panic_fmt
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\/src\libstd\panicking.rs:380
  11: std::panicking::rust_begin_panic
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\/src\libstd\panicking.rs:307
  12: core::panicking::panic_fmt
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\/src\libcore\panicking.rs:84
  13: core::result::unwrap_failed
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\/src\libcore\result.rs:1165
  14: core::result::Result<nickel_postgres::middleware::PostgresMiddleware, alloc::boxed::Box<Error>>::unwrap<nickel_postgres::middleware::PostgresMiddleware,alloc::boxed::Box<Error>>
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\src\libcore\result.rs:933
  15: adbi_online::main
             at .\src\main.rs:29
  16: std::rt::lang_start::{{closure}}<()>
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\src\libstd\rt.rs:64
  17: std::rt::lang_start_internal::{{closure}}
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\/src\libstd\rt.rs:49
  18: std::panicking::try::do_call<closure-0,i32>
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\/src\libstd\panicking.rs:292
  19: panic_unwind::__rust_maybe_catch_panic
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\/src\libpanic_unwind\lib.rs:80
  20: std::panicking::try
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\/src\libstd\panicking.rs:271
  21: std::panic::catch_unwind
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\/src\libstd\panic.rs:394
  22: std::rt::lang_start_internal
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\/src\libstd\rt.rs:48
  23: std::rt::lang_start<()>
             at /rustc/032a53a06ce293571e51bbe621a5c480e8a28e95\src\libstd\rt.rs:64
  24: main
  25: invoke_main
             at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
  26: __scrt_common_main_seh
             at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
  27: BaseThreadInitThunk
  28: RtlUserThreadStart
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

By the way I am on Windows.

from nickel.rs.

jolhoeft avatar jolhoeft commented on August 15, 2024

To clarify, under Windows, with wifi off, the following fails as above:

let mut server = Nickel::new();
server.listen("127.0.0.1:5010");

but this would work?

let mut server = Nickel::new();
server.listen("localhost:5010");

This is rather puzzling. What version of windows are you using? I presume turning the wifi back on fixes this?

from nickel.rs.

Ragueel avatar Ragueel commented on August 15, 2024

I found out the issue. It was one of my custom middleware that tried to access the internet and thus caused errors when I tried to register it. After removing it everything works. Sorry :)

from nickel.rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.