Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rommf's avatar
Level 1

soketi error Pusher error: cURL error 7

I can’t figure out how to send a message via a socket, the front connects normally and listens, but the back can’t transmit the message, I keep getting the error Pusher error: cURL error 7: Failed to connect to localhost port 6001 after 0 ms: Couldn't connect to server ( see https: / /curl.haxx.se/libcurl/c/libcurl-errors.html) for http :/ / localhost:6001/apps/1/events

development is carried out in docker containers, I installed the socketi_server container env parameters: PUSHER_APP_ID=1 PUSHER_APP_KEY=asd PUSHER_APP_SECRET=asd PUSHER_APP_CLUSTER=mt1 PUSHER_HOST=localhost PUSHER_PORT=6001 PUSHER_SCHEME=http

код

class TestEvent implements ShouldBroadcastNow { use Dispatchable, InteractsWithSockets, SerializesModels;

public function __construct(
    private $user_id,
    private $text
)
{
    //
}

public function broadcastOn(): array
{
    return [
        new PrivateChannel('posts_'. $this->user_id),
    ];
}

public function broadcastAs()
{
    return 'postCreted';
}

public function broadcastWith()
{
    return ['message' => $this->text];
}

}

If anyone has encountered this problem and solved it please share

0 likes
0 replies

Please or to participate in this conversation.