Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error while access to url localhost:8080 #152

Open
15520528 opened this issue Mar 1, 2019 · 4 comments
Open

error while access to url localhost:8080 #152

15520528 opened this issue Mar 1, 2019 · 4 comments

Comments

@15520528
Copy link

15520528 commented Mar 1, 2019

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))
}
@2pd
Copy link

2pd commented Jul 11, 2019

go -i run main.go
try this

@wrunk
Copy link

wrunk commented Nov 11, 2019

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

@kluevandrew
Copy link

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

@mcshaman
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants