I'm working on a Macbook Pro with OSX 10.11.3, and the Golang version is 1.5,
following is my testing code
package main
import (
"net/http"
"fmt"
)
func main(){
http.HandleFunc("/", processGET)
c := &http.Server{
Addr: ":8080",
}
c.ListenAndServe()
}
func processGET(w http.ResponseWriter, r *http.Request){
fmt.Println(r.RemoteAddr)
}
The expected result should print the ip and the request port of the client on the command line screen,
however, each time I connected to the http server(testing with Chrome on iPhone and Macbook separately), I got two records with same ip(same request, of course) and different ports(requesting port), like this,
192.168.11.2:53061
192.168.11.2:53062
Does that mean the client initiate two requests at one time? I searched about the http protocol request information but still have no idea.
Thanks!