ltm rule command HTTP2 pushΒΆ

iRule(1)						BIG-IP TMSH Manual						  iRule(1)

HTTP2::push
       Accepts a resource as a parameter that can be pushed to the client using PUSH_PROMISE frames in HTTP/2 stream.

SYNOPSIS
       HTTP2::push PUSH_URI_STRING
		       ('-priority' PRIORITY )?
		       (('-content' CONTENT ) | ('-ifile' IFILE_OBJ ))?
		       ('-noserver')?
		       ('-nohost')?
		       (HTTP_HEADER_NAME HTTP_HEADER_VALUE)*
		       ('--')?
		       (HTTP_HEADER_NAME HTTP_HEADER_VALUE)*

DESCRIPTION
       This command has two variants.

       The first takes a requested resource, and then sends a PUSH_PROMISE frame describing that resource to the client.  The
       resource is requested from the server, and the payload is sent to the client on the pushed stream.

       The second method of using this command describes both the request and the response.  The request is sent as a PUSH_PROMISE
       to the client, and the response follows.  The server is not contacted, and the content is pushed directly from the BigIP.

       Note that this command may cause iRule events to trigger on the newly pushed stream.  In particular, the HTTP_REQUEST event
       may fire.  The HTTP::push command will not do anything on a pushed stream.

       If the response is generated by the BigIP, then it will have a "Server: BigIP" header added by default to differentiate
       replies generated from the BIG-IP versus those from actual servers.  The '-noserver' flag may be used to suppress this.
       The "Content-Length" header is computed and supplied automatically.

       By default, a Host header is required on the request.  This will be converted into the corresponding HTTP/2 :authority
       header in the PUSH_PROMISE frame.  If this is unwanted, then '-nohost' will disable the checking for that.

       Syntax

       HTTP2::push  [-priority ] [-nohost] 

	    * Generates a push to the client, and asks for the indicated resource from the server.  The server-generated resource will be forwarded to the client.

       HTTP2::push  [-priority ] (-content  | -ifile ) [-noserver] [-nohost]  --
       

	    * Generates a push to the client.  Both the pushed request and response are created from the supplied content and header values.

RETURN VALUE
VALID DURING
       HTTP_REQUEST

EXAMPLES
	Always push "/index.html" on every request.  The contents of that file are retrieved from the server.

	when HTTP_REQUEST {
	    HTTP2::push /index.html host example.com
	}

	Push /test_push.html if /index.html is requested.  If /test_push.html is requested by a GET, then use HTTP::respond to generate it.

	when HTTP_REQUEST {
	    set mycontent "HTTP ServerTest Body\n"

	    if { [HTTP::uri -normalized] equals "/index.html" } {
	       HTTP2::push /test_push.html -content $mycontent -noserver host example.com test_reqheader test_reqvalue -- test_respheader test_respvalue
	    }
	    # Handle a GET
	    if { [HTTP::uri -normalized] equals "/test_push.html" } {
	       HTTP::respond 200 -content $mycontent -noserver test_respheader test_respvalue
	    }
	}

HINTS
SEE ALSO
CHANGE LOG
       @BIGIP-14.1.0
	   --First introduced the command.

BIG-IP							    2022-04-12							  iRule(1)