I get a firewall warning when I start gqlgen's server.go on my Mac

When I start the development server (GraphQL Playground) of gqlgen, which is Go's GraphQL server library, on a Mac, a firewall warning appears, which is annoying. 20210108160313.png

I usually set an exception in the security and privacy firewall settings in my Mac preferences, but it didn't work and I'll fix it in another way.

At the end of server.go it looks like this:

log.Fatal(http.ListenAndServe(":"+port, nil))

In this case, it seems to listen with "0.0.0.0". 0.0.0.0 refers to all network interfaces and is excessive.

Change to specify "localhost" or "127.0.0.1" as shown below.

log.Fatal(http.ListenAndServe("localhost:"+port, nil))

Now the warning is gone.

Recommended Posts

I get a firewall warning when I start gqlgen's server.go on my Mac
I installed Linux on my Mac
I installed Kivy on a Mac environment
Error, warning when using TensorFlow on Mac
Bash was Zsh when I updated my Mac
When I get a chromedriver error in Selenium
I get a UnicodeDecodeError when running with mod_wsgi
I get a java.util.regex.PatternSyntaxException when splitting a string in PySpark
What I did when I stumbled on a Django tutorial
I got a UnicodeDecodeError when pip install on ubuntu
I want a Spotify sleep timer on my PC
A solution when you can't start project Django on Windows
I get [Error 2055] when trying to connect to MySQL on Heroku
When I made a Discord Bot, my classmates destroyed my computer
A note when I can't open Jupyter Notebook on Windows
A memorandum when I tried to get it automatically with selenium
A note I was addicted to when making a beep on Linux
When I get an error with Pylint in Atom on Windows
I get a can't set attribute when using @property in python
What I stumbled upon when using CodeIgniter on a Linux server