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

how to print client IP addrs on my server? #490

Open
anyanfei opened this issue Nov 9, 2022 · 0 comments
Open

how to print client IP addrs on my server? #490

anyanfei opened this issue Nov 9, 2022 · 0 comments

Comments

@anyanfei
Copy link

anyanfei commented Nov 9, 2022

Excuse me, how to print client IP addrs on my server?

func main() {
flag.Usage = func() {
flag.PrintDefaults()
}
flag.Parse()
if serverPort == "" {
log.Fatalln("Error: please setting correct server port")
}
endProxy := goproxy.NewProxyHttpServer()
endProxy.Verbose = true
auth.ProxyBasic(endProxy, "my_realm", func(user, pwd string) bool {
return user == username && pwd == password
})
log.Println("serving proxy server port at", serverPort)
http.ListenAndServe(":"+serverPort, endProxy)
fmt.Println("The proxy server end.")
}

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

1 participant