I got problems with this code: https://goplay.tools/snippet/WtyAy6eaZ66
When I’m trying to run this file with
go run main.go localhost:8001, I’m getting
dial tcp 127.0.0.1:8001: connect: connection refused.
It works when I run on port 80:
go run main.go localhost:80
After that when I type something in the prompt and press Enter I’m getting
->: HTTP/1.1 400 Bad Request error. I can’t figure out what’s the problem.
I will be grateful for any suggestions.