Prevent Windows Defender warnings in singleplayer (Bind singleplayer server to 127.0.0.1) #13930
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR stops Minetest from throwing Windows Defender firewall warnings on Windows when playing singleplayer, by always binding the simple singleplayer server to 127.0.0.1.
Previously, it would listen on 0.0.0.0. But even if it would refuse connections from anyone other than "singleplayer", Windows treats this as wanting to break through the firewall, showing the user a warning and asking if it should be allowed.
In addition to this looking a little bit sketchy for someone who's just starting up Minetest for the first time, if a player refuses this then hosting a server sometime later won't work unless you go into Windows Defender and edit the firewall rule.
To do
This PR is Ready for Review.
How to test
Obtain Windows, and have Windows Defender enabled (obviously)
Go into the Windows Defender firewall settings and make sure that there are no entries for
minetest.exe
, delete any that may already exist:Run Minetest with this PR, and start a singleplayer world
There should be no Windows Defender warning that shows up.
In addition, test hosting a server from the main menu will bind to 0.0.0.0 by default (which should cause a warning in Windows Defender) and that connecting to a singleplayer server hasn't somehow broken on a platform because of this.