Known HTTP Download Headers

From Gnutella Developers

<< Known Gnutella Connection Headers | Known GGEP Extension Blocks >> | Main Page

HTTP Headers

For the complete documentation of standard HTTP headers refer to RFC 2616. Note: The line breaks in the below examples are only added to keep the table at a reasonable width.

HTTP Client Request Headers

Header Status Usage Example
Host: Recommended (mandatory in HTTP/1.1) Public address of the HTTP server, as used by the client
User-Agent: Mandatory in Gnutella (recommended in HTTP) The user agent (for the client only)
  LimeWire/4.8.2 (Pro)
Connection: keep-alive Optional

Indicates to a HTTP/1.0 server to keep the connection persistent. In absence of this request header, the client MUST close itself the connection after receiving the response, if the server is HTTP/1.0, and returns Content-Length and/or Request-Range headers, and has not already closed the connection. Recommended only for HTTP/1.0-only clients that may perform multiple successive requests to the same server. Not necessary for HTTP/1.1 clients if the server is already known to be compatible with HTTP/1.1.

Connection: keep-alive
Connection: close Optional

No effect on most HTTP/1.0 servers. Indicates to a HTTP/1.1 server that a persistent conection is not needed. A HTTP/1.1 server will not close the connection itself, but will indicate to the client to close the connection after parsing the server response. Recommended only for HTTP/1.1 clients that will NOT perform sucessive requests to the same server, as this will save server resources.

Connection: close
Range: Mandatory with some Gnutella-based servers (optional in HTTP) Requested range
Range: bytes=4932766-5066083
X-Gnutella-Alternate-Location: Recommended Known alternate locations for the file (HUGE extension) (see HTTP Server Response Headers)
X-Alt: Recommended Replacement for X-Gnutella-Alternate-Location. (see HTTP Server Response Headers)
X-Features: Optional Indicates support of the listed features. (see HTTP Server Response Headers)

HTTP Server Response Headers

Header Status Usage Examples
Server: Mandatory Same as User-Agent for the server (optional in HTTP)
Server: BearShare/2.9.0
Server: LimeWire/4.8.2 (Pro)
Connection: keep-alive Optional (only for HTTP/1.0 servers)

Indicates to the client that the server keeps the connection persistent at end of its response. In that case, the HTTP/1.0 server MUST return Content-Length and/or Content-Range headers in its response to the client to allow further client requests. The HTTP/1.0 client can then either disconnect or send a new request. Note that HTTP/1.1-compatible servers MUST reply to HTTP/1.0 clients using the HTTP/1.0 protocol, and so will only need to send this header to HTTP/1.0 clients compatible that asked for a persistent connections.

Connection: keep-alive
Connection: close Optional (only for HTTP/1.1 servers)
Indicates to the client that no persistent connection is allowed by the server, so the client MUST close itself the connection after parsing the server response. Recommended in responses to HTTP/1.0 and HTTP/1.1 clients that did not ask for a persistent connection. The server MUST then ignore and discard all further request from the client until it disconnects or a long enough delay has ellapsed without data coming from the client.
Connection: close
Content-Type: Recommended (as in HTTP) Content type of requested file
Content-Type: application/binary
Content-Length: Mandatory for HTTP/1.1 or persistent connections Full length of requested file. (see also Content-Range:)
Content-Length: 5332732
Accept-Ranges: Optional (as in HTTP/1.1) Support of ranges (this header is not required to get a partial GET)
Accept-Ranges: bytes
X-Gnutella-Content-URN: Recommended HUGE URN of the requested file
X-Gnutella-Alternate-Location: Recommended Known alternate locations of the file (see HUGE for more information)
X-Alt: Recommended Replacement for X-Gnutella-Alternate-Location using a shorter and less generic format. An absent port number indicates the standard Gnutella port 6346. See The Download Mesh.
X-Alt: <GUID>;,
X-NAlt: Recommended Negative version of X-Alt listing sources that should be removed from the Download Mesh.
X-Create-Time: Optional The time at which this object was created - if possible the network wide creation time should be used instead of client local creation time. The time is given as the number of milliseconds since the Epoch (UTC).
X-Create-Time: 1111286359221
X-Features: Optional Indicates support of the listed features e.g., a queuing method.
X-Features: queue/1.0
X-Node: Optional Indicates that the server can accept incoming connection at the given address and port. This is

useful if a client sent a Push request to let the server connect instead of connecting directly to the server.

X-Thex-URI: Optional The URI of the tree hash for the requested object followed by its root hash. See Partial File Sharing Protocol (PFSP) and Tree Hash EXchange format (THEX).
  <root hash>
Retry-After: Recommended (as in HTTP) Time to wait before next attempt to get the file
Retry-After: 115200
Content-Range: Mandatory for Range GET requests (as in HTTP) Range of the partial fragment returned from the requested file
  bytes 4932766-5066083/5332732
X-Available-Ranges: Recommended The X-Available-Ranges header is used by the server to inform the client about what ranges are available. See also PFSP.
X-Available-Ranges: bytes 0-10,20-30

<< Known Gnutella Connection Headers | Known GGEP Extension Blocks >> | Main Page