1
0
mirror of https://github.com/schollz/croc.git synced 2024-11-28 01:16:10 +03:00

print other

This commit is contained in:
Zack Scholl 2018-07-01 14:30:12 -07:00
parent 5ca6a6455e
commit b09955561f

View File

@ -20,9 +20,9 @@ func (c *Croc) startServer() (err error) {
var upgrader = websocket.Upgrader{} // use default options
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
// incoming websocket request
log.Debugf("connecting remote addr: %+v", r)
log.Debugf("connecting remote addr: %+v", r.RemoteAddr)
ws, err := upgrader.Upgrade(w, r, nil)
address := ws.RemoteAddr().String()
address := r.RemoteAddr
if _, ok := r.Header["X-Forwarded-For"]; ok {
address = r.Header["X-Forwarded-For"][0]
}