centrifugal / phpcent

PHP library to communicate with Centrifugo HTTP API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Disable curl's IPv6 host name resolution

SteveTherrien opened this issue · comments

I'm running into a problem where my application logs this error with phpcent several times each day:

cURL error: Resolving timed out after 2512 milliseconds

I'm using an internal DNS server and the timeout is 2s. We're IPv4 internally and don't use/publish IPv6 records.

Forcing IPv4 resolution with curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); solves the problem, and haven't had a single error in over 20 days, but that capability isn't exposed.

Would it be possible to let this option be set?

@SteveTherrien hello, could you send pr? I suppose sth like forceIpResolveV4 method makes sense.