ltm rule command WS payloadΒΆ

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

WS::payload
       Queries for or manipulates Websocket frame payload information. With this command, you can retrieve payload, query for
       collected payload size, or replace a certain amount of payload.

SYNOPSIS
       WS::payload (LENGTH | (OFFSET LENGTH))?

       WS::payload length

       WS::payload replace OFFSET LENGTH STRING

DESCRIPTION
       WS::payload 
	   Returns the content that the WS::collect command has collected thus far, up to the number of bytes specified. If you do
       not specify a size, the system returns the entire collected content.

       WS::payload  
	   Returns the content that the WS::collect command has collected thus far from the specified offset, up to the number of
       bytes specified.

       WS::payload length
	   Returns the size of the content that has been collected thus far, in bytes.

       WS::payload replace   
	   Replaces the amount of content that you specified with the  argument, starting at  with ,
       adjusting the frame length in frame header appropriately. The length argument should be the length of original content to
       replace. In order to replace the entire payload, the offset should be 0 and the length should be the original size in bytes
       of the payload.

RETURN VALUE
VALID DURING
       WS_CLIENT_DATA WS_SERVER_DATA

EXAMPLES
	when WS_CLIENT_FRAME {
	    WS::collect frame 1000
	    set clen 1000
	}

	when WS_CLIENT_DATA {
	    regsub -all "oursite" [WS::payload] "oursitedev" newdata
	    log local0. "Replacing payload with new data."
	    WS::payload replace 0 $clen $newdata
	    WS::release
	}

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

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