16 lines
257 B
Go
16 lines
257 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
)
|
|
|
|
func respondWithIp(writer http.ResponseWriter, request *http.Request) {
|
|
fmt.Fprintf(writer, "%s\n", request.RemoteAddr)
|
|
}
|
|
|
|
func main() {
|
|
http.HandleFunc("/", respondWithIp)
|
|
http.ListenAndServe(":8080", nil)
|
|
}
|