'Guzzle incoming data isn't showing because of missing proxy

I'v been working on a project but got stuck on the following problem, when I want to receive data from a incoming address I got the following error message:

cURL error 7: Unsupported proxy scheme for 'tcp://localhost:9124'

My code:

    $client = new Client(['http_errors' => false]);
    $response = $client->request(
        'GET',
        $url . $method,
        ['query' =>
            $query
        ]);

    $xml = $response->getBody()->getContents();
    $xml = new SimpleXMLElement($xml);
    $xml = simplexml_load_string($xml);

    $json = json_decode(json_encode(response()->json($xml)), true);

I've read several solution but all of them showing that they are using a proxy, but like my code is showing, I don't using any proxy, I just use my localhost to directly get the information.

I've installed lets encrypt for SSL, but on both paths it doesn't work, localhost or by a ssl request.

What is wrong with my code, I use laravel 8, guzzle 7.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source