@@ -133,14 +179,110 @@ func proxyHandler(w http.ResponseWriter, r *http.Request) {
...
@@ -133,14 +179,110 @@ func proxyHandler(w http.ResponseWriter, r *http.Request) {
}
}
log.Printf("stop forward to rpc on eth_getBalance request from %s, X-Real-IP: %s, X-Forwarded-For: %s, address: %v",r.RemoteAddr,realIp,xForwardedFor,req.Params[0])
log.Printf("stop forward to rpc on eth_getBalance request from %s, X-Real-IP: %s, X-Forwarded-For: %s, address: %v",r.RemoteAddr,realIp,xForwardedFor,req.Params[0])
w.Header().Set("Content-Type","application/json")
w.Header().Set("Content-Type","application/json")
json.NewEncoder(w).Encode(resp)
iferr:=json.NewEncoder(w).Encode(resp);err!=nil{
log.Printf("encode response error: %v",err)
}
return
return
}
}
}
}
// First, special-case eth_sendRawTransaction: extract sender from raw tx