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.
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