gin icon indicating copy to clipboard operation
gin copied to clipboard

error while access to url localhost:8080

Open 15520528 opened this issue 5 years ago • 4 comments

i got those error while access to url localhost:8080

2019/03/01 16:34:17 http: proxy error: dial tcp 127.0.0.1:3001: connect: connection refused

here my code

func handler(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:])
}

func StartService() {
	http.HandleFunc("/", handler)
	log.Fatal(http.ListenAndServe(":8080", nil))
}

15520528 avatar Mar 01 '19 09:03 15520528

go -i run main.go try this

2pd avatar Jul 11 '19 02:07 2pd

you mean gin -i ....? Using the -i option helped for me

wrunk avatar Nov 11 '19 05:11 wrunk

you mean gin -i ....? Using the -i option helped for me

Confirm. In my case gin -i --appPort 8080 --port 3000 run main.go is useful

kluevandrew avatar Apr 27 '21 18:04 kluevandrew

I ran into this issue as well. Found that if you put the --appPort flag after the run . then it will use the default flag i.e 3001. So as long as I put run . or run main.go at the end of the command everything worked as expected.

mcshaman avatar May 18 '24 06:05 mcshaman