diff --git a/httpRequest.proto b/httpRequest.proto index cc49b87..5b3d2c7 100644 --- a/httpRequest.proto +++ b/httpRequest.proto @@ -8,11 +8,11 @@ import "google/protobuf/timestamp.proto"; // Import the well-known type for Time message HttpRequest { // HttpRequest represents the essential fields of an incoming HTTP request. string method = 1; // The request method, e.g., "GET", "POST". - string url = 2; // The full URL of the request, including scheme, host, path, and query string. + string URL = 2; // The full URL of the request, including scheme, host, path, and query string. string route = 3; // just the route: "/add/" or "/find/" string proto = 4; // The protocol version, e.g., "HTTP/1.1", "HTTP/2.0". map headers = 5; // The map of request headers. Header names are case-insensitive, - string remoteAddr = 6; // The remote IP address of the client, after resolving proxies. + string IP = 6; // The remote IP address of the client, after resolving proxies. string host = 7; // The host on which the URL is sought (www.wit.com) string hostname = 8; // The hostname of the client if passed from the client (mylaptop.fun.me) bytes body = 9; // The request body as raw bytes. diff --git a/reqToPB.go b/reqToPB.go index 747f1d4..f5aa766 100644 --- a/reqToPB.go +++ b/reqToPB.go @@ -58,14 +58,14 @@ func ReqToPB(r *http.Request) (*HttpRequest, error) { // log.Info("TRYING TO MARSHAL bytes:", len(msg), err) pb := &HttpRequest{ - Method: r.Method, - Url: r.URL.String(), - Proto: r.Proto, - Headers: headers, - RemoteAddr: getClientIP(r), - Host: r.Host, - Body: msg, - Hostname: r.Header.Get("hostname"), + Method: r.Method, + URL: r.URL.String(), + Proto: r.Proto, + Headers: headers, + IP: getClientIP(r), + Host: r.Host, + Body: msg, + Hostname: r.Header.Get("hostname"), } pb.Route = cleanURL(r.URL.Path)