Fortinet white logo
Fortinet white logo

Script Reference Guide

HTTP:local_port()

HTTP:local_port()

Returns the local port number in a string format.

In HTTP_REQUEST, local_port is the virtual server port.

In HTTP_RESPONSE, local_port is the port of the gateway that was used to connect.

Syntax

HTTP:local_port();

Arguments

N/A

Events

Applicable in the following events:

  • HTTP_REQUEST

  • HTTP_RESPONSE

  • HTTP_DATA_REQUEST

  • HTTP_DATA_RESPONSE

Example

when HTTP_REQUEST {
string1=HTTP:client_port()
string2=HTTP:local_port()
string3=HTTP:remote_port()
debug("result_client_port: %s \n",string1)
debug("result_local_port: %s \n",string2)
debug("result_remote_port: %s \n",string3)
}

Supported Version

FortiADC version 4.8.x and later.

HTTP:local_port()

HTTP:local_port()

Returns the local port number in a string format.

In HTTP_REQUEST, local_port is the virtual server port.

In HTTP_RESPONSE, local_port is the port of the gateway that was used to connect.

Syntax

HTTP:local_port();

Arguments

N/A

Events

Applicable in the following events:

  • HTTP_REQUEST

  • HTTP_RESPONSE

  • HTTP_DATA_REQUEST

  • HTTP_DATA_RESPONSE

Example

when HTTP_REQUEST {
string1=HTTP:client_port()
string2=HTTP:local_port()
string3=HTTP:remote_port()
debug("result_client_port: %s \n",string1)
debug("result_local_port: %s \n",string2)
debug("result_remote_port: %s \n",string3)
}

Supported Version

FortiADC version 4.8.x and later.