Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

CURL.SetOptionLocalPort

This sets the local port number of the socket used for connection.

Component Version macOS Windows Linux Server iOS SDK
CURL 2.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "CURL.SetOptionLocalPort"; curl; Value )   More

Parameters

Parameter Description Example
curl The CURL session handle. $curl
Value The port number (1-65535) 8000

Result

Returns "OK" on success.

Description

This sets the local port number of the socket used for connection.
This can be used in combination with CURL.SetOptionInterface and you are recommended to use CURL.SetOptionLocalPortRange as well when this is set. Valid port numbers are 1 - 65535.

Local ports <1024 usually need admin/root permissions to be used.
To set port to connect to, please use CURL.SetOptionPort instead.

See also LOCALPORT option in CURL manual.

See also

Created 18th August 2014, last changed 8th February 2019


CURL.SetOptionKeyPassword - CURL.SetOptionLocalPortRange