Skip to content

[Bug]: Incorrect LAN IP Detection for QR Code #27

@DeveloperAmrit

Description

@DeveloperAmrit

Bug Description

The getLocalIp() helper function in websocket.ts naively iterates through network interfaces and returns the first non-internal IPv4 address it finds.

On developer machines, this often results in selecting a virtual interface IP (e.g., Docker 172.17.0.1, VMWare, or VPN adapters) instead of the actual Wi-Fi LAN IP (e.g., 192.168.x.x).

Steps to Reproduce

  1. Run the application on a machine that has Docker or a VPN installed.
  2. Go to the Settings page in the frontend.
  3. Scan the generated QR code with a mobile device.
  4. Result: The mobile device fails to connect because it is trying to reach an internal/virtual IP address that is not accessible from the phone.

Expected Behavior

  1. The server should filter for the most likely LAN interface (e.g., usually 192.168.* or 10.*).
  2. Alternatively, the server should send a list of all valid candidates to the frontend, and the Settings UI should allow the user to select the correct IP from a dropdown if the auto-detection is wrong.

Desktop Operating System

macOS (Apple Silicon)

Mobile Device (Client)

Vivo T3x 5G

Rein Version

3

Console Logs / Error Messages

Screenshots / Recordings

No response

Checklist

  • I have searched for existing issues to avoid duplicates

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions