I'm working on a Rest API with Go, but everytime I try to run my application with
go run main.go
the Windows Firewall tells me that has blocked some features of my app. I would like to know if there's some way to make my executions without have to Accept everytime.
Change
http.ListenAndServe(":3000", r)
to
http.ListenAndServe("127.0.0.1:3000", r)
If you are calling go run main.go
following is happening:
But the temporary folder is just for one execution. So the next time when you run your programm via go run
another folder is used.
The windows firewall does give you always the information which path your server has and if you remember the paths after each time you will see that there is always a different path.
The windows firewall is so configuread that it remembers the path of each programm. So when the path is changing you will always need to comfirm that the new path is allowed to run on that port.
To fix this you should compile your server. Just run go build
and exeute the binaries then inside you project folder. Then you will just have to accept just one time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With