Geo
Geo

Reputation: 33

Is there a way to set "local-port" curl option in PHP?

I would like to explicitly define the source port range curl should use for the connections.
In curl docs this option would be local-port, but I can't find any PHP documentation relating to the setup of this curl option.

Upvotes: 2

Views: 2582

Answers (1)

Brad
Brad

Reputation: 163282

There's a comment in the documentation:

Seems like some options not mentioned on this page, but listed on http://curl.haxx.se/libcurl/c/curl_easy_setopt.html is actually supported.

According to the libcurl docs, CURLOPT_LOCALPORT is what you're looking for. Hopefully that's defined in PHP. If it isn't, you can try using the value 139 according to the source.

Upvotes: 3

Related Questions