Hi guys,
I am trying to make my Rocket server to auto connect to - current IP address (only on Windows).
Everything seems to be fine but when I making cargo run
I have OS error 99 like below.
Code:
> fn main()
>
> #[cfg(test)] mod tests;
>
> #[get("/")]
> fn hello() {
> "Hello, world!"
> }
>
> //use rocket::config::{Config, Environment};
>
> let cfg = rocket::config::Config::build(rocket::config::Environment::Development)
> .address(my_internet_ip::get().unwrap().to_string())
> .port(80)
> .unwrap();
>
> rocket::custom(cfg)
> .mount("/", routes![hello])
> .launch();
Terminal
Compiling diesel v0.1.0 (/home/user/diesel-simple)
Finished dev [unoptimized + debuginfo] target(s) in 4.84s
Running target/debug/diesel
Configured for development.
=> address: 185.251.18.122
=> port: 80
=> log: normal
=> workers: 4
=> secret key: generated
=> limits: forms = 32KiB
=> keep-alive: 5s
=> tls: disabled
Mounting /:
=> GET / (hello)
Error: Rocket failed to bind network socket to given address/port.
thread 'main' panicked at 'Cannot assign requested address (os error 99)', /home/bbasz/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket-0.4.3/src/error.rs:192:17
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
I was wondering if maybe this is because my ip4 could not be public... but if i want to build web app, based on Rust, how I can take requests from not a local network on any PC?
I am runing Rust on Ubuntu. Thank you for any help.