addPortForwarding.lua
[INDEX]

ABSTRACT

Add a port forwarding setting

ARGUMENTS

HTTP Arguments submit: GET; POST

Test this API over HTTP - (URL):

Protocol
STRING (MUST)

Specify network protocol, 'tcp' or 'udp' is valid.

Test value:

Listen
STRING (MUST)

Listen at local network interface and port. Format is "address:port", which address can be '*' that means listen at any network interface.

Test value:

Target
STRING (MUST)

Forward the packet to target, format is "address:port", which address is an IP or domain name.

Test value:

Over
STRING

Optional, but it's important for multiple interface transmission. Specify what network interface this forwarding works on. Refer to getNetInterface.lua to get all valid interfaces, check the 'Type' field in result of getNetInterface.lua to get the special interface name of what you want. For example, the interface type equals to 'MODEM' means it is a 3G/4G network interface.

Test value:

MaxPacketSize
INTEGER

Optional. The maximum packet size for data transmission, in KB. The default value is 64 (KB), this suits general applications. Do not set it less than MTU (1500 bytes) size is suggested!

Test value:

SocketRxBuffer
INTEGER

Optional. Socket receiving buffer size, in KB. The default value is 256 (KB). Don't make it to be too small.

Test value:

SocketTxBuffer
INTEGER

Socket sending buffer size, in KB. The default value is 256 (KB).

Test value:

RETURNS

Return a JSON style result. The JSON format is:

{
/*OBJECT*/

"Result":
NUMBER

200 means OK, other error code meanings are similar to HTTP Response.

"Status":
"STRING"

Status message. Responsing result status of API executive, if there errors, it will describe reasons.

}

OTHER NOTES

Device HTTP API, v1.0