mirror of
https://github.com/schollz/croc.git
synced 2024-11-28 01:16:10 +03:00
print other
This commit is contained in:
parent
5ca6a6455e
commit
b09955561f
@ -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]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user