The host cannot access the web service in the virtual machine

  Kiến thức lập trình

I tried to access the web service in the virtual machine from the local host, but failed.

All ports are open, and the host and virtual machine firewalls are off, but it still doesn’t work
virtual machine is archlinux, host is win10. here is code:

use std::net::TcpListener;

fn main() {
    let listener = TcpListener::bind("127.0.0.1:7878").unwrap();

    for stream in listener.incoming() {
        let stream = stream.unwrap();

        println!("Connection established!");
    }
}

LEAVE A COMMENT