@Port()

New in 2.0

Generate random server ports

Network InformationSince 2.0.0

Parameters

NameTypeRequiredDefaultDescription
minInteger1024Minimum port, default 1024 (min 0)
maxInteger65535Maximum port, default 65535 (max 65535)

Usage

@Port()

Generate random server port

Example:
@Port()
Output:
1025
@Port(min,max)

Generate server port within specified min~max range

Example:
@Port(5000,10000)
Output:
6000
← Back to Function Reference