addPortForwarding.lua
[返回首页]

API说明

Add a port forwarding setting

参数

HTTP提交参数:GET; POST

通过HTTP测试该API调用 (URL):

Protocol
字符串 (必需参数)

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

测试值:

Listen
字符串 (必需参数)

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

测试值:

Target
字符串 (必需参数)

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

测试值:

Over
字符串

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.

测试值:

MaxPacketSize
整数

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!

测试值:

SocketRxBuffer
整数

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

测试值:

SocketTxBuffer
整数

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

测试值:

返回

返回JSON格式的结果。该JSON数据的格式如下:

{
/*对象*/

"Result":
数值

200表示OK, 其它错误码含义类似于HTTP Response.

"Status":
"字符串"

状态消息。反馈API执行的结果状态,如有错误,将描述出错的原因。

}

其它说明

KILOVIEW Device HTTP API, v1.0