Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Could not connect to the server." in macOS #6915

Open
gbacskai opened this issue Jun 2, 2022 · 3 comments
Open

Error: Could not connect to the server." in macOS #6915

gbacskai opened this issue Jun 2, 2022 · 3 comments

Comments

@gbacskai
Copy link

gbacskai commented Jun 2, 2022

The error message is the same as as in issue: #6743

but to root cause is that Squirrel server is not reachable as the server is running on 127.0.0.1 but actually on mac I can't ping 127.0.0.1

ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
ping: sendto: Can't assign requested address
ping: sendto: Can't assign requested address
Request timeout for icmp_seq 0

@burgil
Copy link

burgil commented Jun 5, 2022

Hey, Hope that helps: (I just wrote it)

I think, your issue is summed up to networking,

Let me try (not a native English speaker) to teach you about it quickly:

  1. All computers have a public ip, lan ip, and local ip - Some also have an IPV6 ip but let's ignore it assuming every computer with an IPV6 address also have an IPV4 one. they're all do at that point as far as I'm aware, Especially servers.

  2. All computers LOCAL IP is the following: 127.0.0.1

  3. The LAN IP is a unique IP for each device on the network, for example:

  • 10.0.0.20 for your phone
  • 10.0.0.7 for your computer
  • 10.0.0.27 your smart light bulb
    What's funny about this type of connection, is that it allows to connect to every device on the router network, either Wifi connected or Lan cable connected devices, Without what's known as opening ports which is something we will touch later
  1. The PUBLIC IP - All devices on the same network have the same PUBLIC IP, this what allows external computers from the world to connect to you or you to them, we only have 1 of those per router given to us from the ISP, it can change and therefor be dynamic ip or it can remain fixed (usually paid for in your ISP) and then it's known as static ip.
    the range for PUBLIC IP's as of writing this is 0.0.0.0 - 255.255.255.255 , Not that match when you think about it, and half can not be used for whatever reasons.

  2. Now there is one more secret IP every system like this have, the router itself has it's own LAN IP known as the GATEWAY IP, so if you were 10.0.0.20 on your network, your router is probably 10.0.0.1. - THIS IS WHERE YOU OPEN PORTS the username and password is usually either - user admin and pass admin - or - user Admin and pass Admin - unless it was changed, just call your ISP

All of this information is available through the cmd.exe ipconfig command (or on mac\linux google it) beware of other vpn ips you have installed that will appear on that list.

  1. Ok, So now what the heck are ports?

For one pc to send a message to another, whether it's a web server hosting a website or you sending message through an app on your phone, it has to go through from one IP to another right? on that process we don't just send to that IP data,

The other side have to accept connections, we do that with ports, that you can open on any router, basically on your PUBLIC IP, and on your servers, what's known as ports, the process is called port forwarding, you do that usually on both your pc firewall and the router.

  1. But what does it do basically and how it works without reading wikipedia please?
    Ok so basically we don't just send messages directly to an IP: hello world > 127.0.0.1, we have to send it through a port,
    And there's two types of ports, UDP and TCP:
  • UDP is very fast and unreliable, the packets sent through that port will not always reach it's end, good for gaming server for example, but not for checking cheats for example.
  • TCP is reliable, this is what we send messages through, it's also slower, requires like the other pc to confirm again that everything that was sent or received is valid, you will want your messages to reach the other end 100%? use TCP, (well nothing is a 100%)
  1. One more super important fact, ALL websites are running on port 80, AND they also have port 443 open for HTTPS but that's usually configured for you on servers you buy

Now that we know all of that, basically to sum it up in simple terms, I think you need to A) port forward on your server and B) change the IP from the development IP > 127.0.0.1, to your server's public IP, assuming the port is 80 (since you are pinging it directly) the ports you will want to open is TCP 80, and good luck configuring HTTPS with open ssl depending on your need and setup and frameworks you've used

@gbacskai
Copy link
Author

gbacskai commented Jun 5, 2022

The issue is on a laptop where I can't change the network configuration as it is locked down by the company policy.

The solution should be to try the localhost/127.0.0.1 before start the server and if it does not work go to the next device (e.g. eth0).

This is happening with other applications as well like Evernote. It downloads the app but can't install it. I have to install manually the latest versions all the time.

@burgil
Copy link

burgil commented Jun 5, 2022

Sounds like an issue with your company network and not with electron-builder then,
Have you tried to run it on your home network or something other than your work network?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants