ltm rule command TCP respondΒΆ

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

TCP::respond
       Sends the specified data directly to the peer.

SYNOPSIS
       TCP::respond RESPONSE_STRING

DESCRIPTION
       Sends the specified data directly to the peer. This command can be used to complete a protocol handshake via
       an iRule.

       Syntax

       TCP::respond 

	    * Sends the specified data directly to the peer.

RETURN VALUE
       None.

VALID DURING
       CLIENT_ACCEPTED, CLIENT_CLOSED, CLIENT_DATA, SERVER_CLOSED, SERVER_CONNECTED, SERVER_DATA, SIP_REQUEST,
       SIP_REQUEST_SEND, SIP_RESPONSE, STREAM_MATCHED

EXAMPLES
	when HTTP_REQUEST {
	if {([HTTP::method] eq "POST") && [HTTP::header exists "Expect"] } {
	      HTTP::header remove "Expect"
	      TCP::respond "HTTP/1.1 100 Continue\r\n\r\n"
	   }
	}

	when SERVER_CONNECTED {
	    peer { TCP::collect 4 }
	}
	when CLIENT_DATA {
	    if { [TCP::payload] starts_with "EHLO" } {
		TCP::respond "500 5.3.3 Unrecognized command\r\n"
		TCP::payload replace 0 [TCP::payload length] ""
	    }
	    TCP::release
	}

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

BIG-IP						      2020-06-23					     iRule(1)