Tarmslitaren / FrosthavenAssistant

flutter app
GNU Affero General Public License v3.0
188 stars 49 forks source link

MacOs IP Issue #96

Closed jeremympiehler closed 7 months ago

jeremympiehler commented 1 year ago

I'm new at this, so bare with me if this is newb issue. 😄

I'm trying to host the server from my mac. However, when I try to host it only allows me to use an ip address of 0.0.0.0. I can't connect from another device because of that null ip address.

Screenshot 2023-02-15 at 8 56 01 PM IMG_166691DE7958-1

Tarmslitaren commented 1 year ago

for sine reason, the display is sometimes wrong when the computer is connected with ethernet cable. you can find the right value from your system somehow. on windows you'd open terminal and type ipconfig to see the ip's and fron there make note of the local ip (starting with 192.168) to use from the clients.

jeremympiehler commented 1 year ago

I'm using a Mac over WIFI. Do you mean HDMI or Ethernet Internet?

I searched and tried every 192.168.xx.xxx and none of them worked. When I start with the Mac it is still saying 0.0.0.0 for the IP.

Tarmslitaren commented 1 year ago

Sorry I don't know what the cause is or how to fix it. Could potentially be a firewall stopping the connection?

public or work place wifi often block connections so it won't be possible to use in those situations. ( though it's unlikely to be the cause of 0.0.0.0 ip )

Note that the port nr you see in client error message is irrelevant. It is important that the port is set to be same on server and clients for connection to work.

when you start, ( and when connection type changes ) you should get a message at bottom: "connection type: wifi" if you are connected to wifi ( or "connection type: none" if not )

Tarmslitaren commented 1 year ago

you could try to switch which device is server and client, and see if you can get any connection that way, as a test if there's something blocking your mac to connect or if the 0.0.0.0 is only a visual bug

thedoctor692 commented 1 year ago

I just wanted to chime in, I also have this issue on macOS. It's easily reproducible and persists through quits, restarts, etc. -- nothing touches it. Any troubleshooting I can do to help?

Tarmslitaren commented 1 year ago

can someone test if this is still the same on version 1.8.0?

rathe commented 1 year ago

In networking, 0.0.0.0/0 is a stand-in for "all IP addresses". It means the server will accept connections from any source IP without limitation, if the data can reach it (i.e., if firewall exceptions and routing are in place). I cannot answer as to whether X-Haven Assistant is using it in this manner (I note it omits the /0 CIDR notation).

Mac may skew this use, though (I'm not a Mac user). But in my experience, "Start Host Server", when it showed me the 0.0.0.0 IP on my Windows PC, I was able to connect from clients on my home's internal network (in the 10.0.0.0/8 range). The other item listed at the time was my NAT public IP, for which I do not have port forwarding.

This broke as of 1.8.0, however. The 0.0.0.0 item was replaced with another IP my PC uses (one that is not routable on my LAN), and I am now unable to connect from clients connected to my wifi with IPs in the 10.0.0.0/8 range. I was in the middle of filing my own ticket (Edit: Filed #139), when I saw this one. They are likely related, and possibly due to incorrect interface prioritization? Does the X-Haven Assistant app do this?

I can confirm that issue was not fixed in 1.8.1, either.

frostyboskitzo commented 1 year ago

Could a better fix for this be:

-> Application grab all ethernet/wifi IPs -> Presents the user the list (dropdown?) which the user selects to bind the application to -> Keep the existing "Auto" selection logic under the default select option "Auto"

Similar behaviour:

image

Cross comment for Issue #139

I don't know dart well enough to create a PR, but I'm definitely a fan of "choose the IP to bind the service to" from a security perspective.

thedoctor692 commented 1 year ago

can someone test if this is still the same on version 1.8.0?

I just tested with 1.8.2 on my mac with 13.2.1, same issue persists.

Edit: it might be worth noting as well -- I do not have wired internet on this Mac Mini. it's only using WiFi. I wonder if that's messing with things somehow.

Demolira commented 1 year ago

I can confirm this issue occurs on 1.8.3, on an iMac using wireless networking, and a fresh install of Ventura 13.3.1.

I wasn't able to connect to the server using the Mac's IP address.

However, I was able to use the Mac version to connect to a server hosted on my iPhone on the same network.

Tarmslitaren commented 7 months ago

added option to choose ip from a list in version 1.9.0