Skip to content

sending packets to anything else than a local adress doesn't work #301

@TanTanDev

Description

@TanTanDev

I was scratching my head because my client and server worked just fine locally.
It also worked just fine on my vps to run both client and server at the same time.

But as I was trying to connect my computer to my vps(client to server), no connection was ever established.

So I downloaded wireshark to investigate and what I found was that only packets going to a local address, (starting with 127)
Was ever sent.

As a test I was sending a packet to localhost, and then the address of google.com.

    let adress = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 12345);
    let result = packet_sender.send(laminar::Packet::reliable_unordered(adress, [1,1].into()));
    println!(" trying to send to address {} result : {:?}", adress, result);

    // I've verified pinging this address from command line works
    let google_address = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(216, 58, 211, 14)), 22);
    let result = packet_sender.send(laminar::Packet::reliable_unordered(google_address, [1,1].into()));
    println!(" trying to send to address {} result : {:?}", google_address, result);

the println!() both print Ok(())

The only outgoing packets appearing in wireshark filtering with udp, is the packet sent to localhost.

I'm using laminar 0.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions