Odd PHP cURL proxy behavior

I’m trying to request Keycloak container from another container within the same network using PHP curl with proxy. The Keycloak’s service name is keycloak and its exposed port is 8080.

Here is my code:

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "http://localhost:10210/realms/test/.well-known/openid-configuration");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PROXY, "keycloak:8080");

$response = curl_exec($ch);

curl_close($ch);

When I execute this code I receive this error message:

{"error":"RESTEASY003210: Could not find resource for full path: http://localhost:10210http://localhost:10210/realms/test/.well-known/openid-configuration"}

It looks like it duplicates the hostname when I use proxy option and I have no idea why it happens.