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

AlessandroCursoli's avatar

"Pusher error: cURL error 52: Empty reply from server" On Sail image of Soketi

Hi, i'm using soketi to create a little chat app, i can connect to soketi but, when i try to send an event i get this error Pusher error: cURL error 52: Empty reply from server.

I found one solution which is to insert this 'client_options' => ['verify' => false,] in the broadcasting.php under the pusher connection, but i read it is outdated.

For now i'm on a local install of sail and soketi.

My Echo config

window.Echo = new Echo({
    broadcaster: 'pusher',
    key: import.meta.env.VITE_PUSHER_APP_KEY,
    //cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER ?? 'eu',
    cluster:'mt1',
    //wsHost: import.meta.env.VITE_PUSHER_HOST ? import.meta.env.VITE_PUSHER_HOST : `127.0.0.1`,
    wsHost: `127.0.0.1`,
    wssHost: `127.0.0.1`,
    wsPort: import.meta.env.VITE_PUSHER_PORT ?? 6001,
    wssPort: import.meta.env.VITE_PUSHER_PORT ?? 6001,
    //forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
    forceTLS: 'http',
    enabledTransports: ['ws', 'wss'],
    forceTLS: false,
    encrypted: true,
    disableStats: true,
});

broadcasting.php settings:

            'driver' => 'pusher',
            'key' => env('PUSHER_APP_KEY'),
            'secret' => env('PUSHER_APP_SECRET'),
            'app_id' => env('PUSHER_APP_ID'),
            'options' => [
                'host' => env('PUSHER_HOST', '127.0.0.1'),
                'port' => env('PUSHER_PORT', 6001),
                'scheme' => env('PUSHER_SCHEME', 'http'),
                'encrypted' => false,
                'useTLS' => env('PUSHER_SCHEME') === 'https',
            ],
            'client_options' => [
                // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
                'verify' => false,
            ],
        ],

This is an error log on the soketi console:

{
    ws: uWS.WebSocket {
      ip: '172.18.0.1',
      ip2: '',
      appKey: '85007e4a489a74a21006',
      sendJson: [Function (anonymous)],
      id: '1360198586.5403691754',
      subscribedChannels: Set(0) {},
      presence: Map(0) {},
      app: App {
        initialApp: [Object],
        server: [Server],
        enableUserAuthentication: false,
        hasClientEventWebhooks: false,
        hasChannelOccupiedWebhooks: false,
        hasChannelVacatedWebhooks: false,
        hasMemberAddedWebhooks: false,
        hasMemberRemovedWebhooks: false,
        hasCacheMissedWebhooks: false,
        id: '1750325',
        key: '85007e4a489a74a21006',
        secret: '0a1a6e9705f6d966cc43',
        maxConnections: -1,
        enableClientMessages: false,
        enabled: true,
        maxClientEventsPerSecond: -1,
        maxPresenceMembersPerChannel: 100,
        maxPresenceMemberSizeInKb: 2,
        maxChannelNameLength: 200,
        maxEventChannelsAtOnce: 100,
        maxEventNameLength: 200,
        maxEventPayloadInKb: 100,
        maxEventBatchSize: 10
      },
      timeout: Timeout {
        _idleTimeout: 120000,
        _idlePrev: [TimersList],
        _idleNext: [TimersList],
        _idleStart: 11024775,
        _onTimeout: [Function (anonymous)],
        _timerArgs: undefined,
        _repeat: null,
        _destroyed: false,
        [Symbol(refed)]: true,
        [Symbol(kHasPrimitive)]: false,
        [Symbol(asyncId)]: 22956,
        [Symbol(triggerId)]: 0
      }
    },
    code: 1001,
    message: ArrayBuffer { [Uint8Contents]: <>, byteLength: 0 }
  }
     [Mon Feb 12 2024 13:50:54 GMT+0000 (Coordinated Universal Time)] 👨‍🔬 New connection:   
  {
    ws: uWS.WebSocket {
      ip: '172.18.0.1',
      ip2: '',
      appKey: '85007e4a489a74a21006'
    }
  }
     [Mon Feb 12 2024 13:50:54 GMT+0000 (Coordinated Universal Time)] ✈ Sent message to client:   
  {
    ws: uWS.WebSocket {
      ip: '172.18.0.1',
      ip2: '',
      appKey: '85007e4a489a74a21006',
      sendJson: [Function (anonymous)],
      id: '2915440659.4987855848',
      subscribedChannels: Set(0) {},
      presence: Map(0) {},
      app: App {
        initialApp: [Object],
        server: [Server],
        enableUserAuthentication: false,
        hasClientEventWebhooks: false,
        hasChannelOccupiedWebhooks: false,
        hasChannelVacatedWebhooks: false,
        hasMemberAddedWebhooks: false,
        hasMemberRemovedWebhooks: false,
        hasCacheMissedWebhooks: false,
        id: '1750325',
        key: '85007e4a489a74a21006',
        secret: '0a1a6e9705f6d966cc43',
        maxConnections: -1,
        enableClientMessages: false,
        enabled: true,
        maxClientEventsPerSecond: -1,
        maxPresenceMembersPerChannel: 100,
        maxPresenceMemberSizeInKb: 2,
        maxChannelNameLength: 200,
        maxEventChannelsAtOnce: 100,
        maxEventNameLength: 200,
        maxEventPayloadInKb: 100,
        maxEventBatchSize: 10
      },
      timeout: Timeout {
        _idleTimeout: 120000,
        _idlePrev: [TimersList],
        _idleNext: [TimersList],
        _idleStart: 11038779,
        _onTimeout: [Function (anonymous)],
        _timerArgs: undefined,
        _repeat: null,
        _destroyed: false,
        [Symbol(refed)]: true,
        [Symbol(kHasPrimitive)]: false,
        [Symbol(asyncId)]: 22987,
        [Symbol(triggerId)]: 0
      }
    },
    data: {
      event: 'pusher:connection_established',
      data: '{"socket_id":"2915440659.4987855848","activity_timeout":30}'
    }
  }
     [Mon Feb 12 2024 13:51:02 GMT+0000 (Coordinated Universal Time)] ⚡ New message received:   
  {
    message: {
      event: 'pusher:subscribe',
      data: {
        auth: 'd1ab91306c093fb4ddec:1ae12b831deb6c4679d239c3e09b8d93fe3f3a321c9de6df24ef177eeb47c3ec',
        channel: 'private-App.Models.User.1'
      }
    },
    isBinary: false
  }
     [Mon Feb 12 2024 13:51:02 GMT+0000 (Coordinated Universal Time)] ✈ Sent message to client:   
  {
    ws: uWS.WebSocket {
      ip: '172.18.0.1',
      ip2: '',
      appKey: '85007e4a489a74a21006',
      sendJson: [Function (anonymous)],
      id: '2915440659.4987855848',
      subscribedChannels: Set(0) {},
      presence: Map(0) {},
      app: App {
        initialApp: [Object],
        server: [Server],
        enableUserAuthentication: false,
        hasClientEventWebhooks: false,
        hasChannelOccupiedWebhooks: false,
        hasChannelVacatedWebhooks: false,
        hasMemberAddedWebhooks: false,
        hasMemberRemovedWebhooks: false,
        hasCacheMissedWebhooks: false,
        id: '1750325',
        key: '85007e4a489a74a21006',
        secret: '0a1a6e9705f6d966cc43',
        maxConnections: -1,
        enableClientMessages: false,
        enabled: true,
        maxClientEventsPerSecond: -1,
        maxPresenceMembersPerChannel: 100,
        maxPresenceMemberSizeInKb: 2,
        maxChannelNameLength: 200,
        maxEventChannelsAtOnce: 100,
        maxEventNameLength: 200,
        maxEventPayloadInKb: 100,
        maxEventBatchSize: 10
      },
      timeout: Timeout {
        _idleTimeout: 120000,
        _idlePrev: [TimersList],
        _idleNext: [TimersList],
        _idleStart: 11047173,
        _onTimeout: [Function (anonymous)],
        _timerArgs: undefined,
        _repeat: null,
        _destroyed: false,
        [Symbol(refed)]: true,
        [Symbol(kHasPrimitive)]: false,
        [Symbol(asyncId)]: 23007,
        [Symbol(triggerId)]: 0
      }
    },
    data: {
      event: 'pusher:subscription_error',
      channel: 'private-App.Models.User.1',
      data: {
        type: 'AuthError',
        error: 'The connection is unauthorized.',
        status: 401
      }
    }
  }
     [Mon Feb 12 2024 13:51:33 GMT+0000 (Coordinated Universal Time)] ⚡ New message received:   
  { message: { event: 'pusher:ping', data: {} }, isBinary: false }
     [Mon Feb 12 2024 13:51:33 GMT+0000 (Coordinated Universal Time)] ✈ Sent message to client:   
  {
    ws: uWS.WebSocket {
      ip: '172.18.0.1',
      ip2: '',
      appKey: '85007e4a489a74a21006',
      sendJson: [Function (anonymous)],
      id: '2915440659.4987855848',
      subscribedChannels: Set(0) {},
      presence: Map(0) {},
      app: App {
        initialApp: [Object],
        server: [Server],
        enableUserAuthentication: false,
        hasClientEventWebhooks: false,
        hasChannelOccupiedWebhooks: false,
        hasChannelVacatedWebhooks: false,
        hasMemberAddedWebhooks: false,
        hasMemberRemovedWebhooks: false,
        hasCacheMissedWebhooks: false,
        id: '1750325',
        key: '85007e4a489a74a21006',
        secret: '0a1a6e9705f6d966cc43',
        maxConnections: -1,
        enableClientMessages: false,
        enabled: true,
        maxClientEventsPerSecond: -1,
        maxPresenceMembersPerChannel: 100,
        maxPresenceMemberSizeInKb: 2,
        maxChannelNameLength: 200,
        maxEventChannelsAtOnce: 100,
        maxEventNameLength: 200,
        maxEventPayloadInKb: 100,
        maxEventBatchSize: 10
      },
      timeout: Timeout {
        _idleTimeout: 120000,
        _idlePrev: [TimersList],
        _idleNext: [TimersList],
        _idleStart: 11077768,
        _onTimeout: [Function (anonymous)],
        _timerArgs: undefined,
        _repeat: null,
        _destroyed: false,
        [Symbol(refed)]: true,
        [Symbol(kHasPrimitive)]: false,
        [Symbol(asyncId)]: 23072,
        [Symbol(triggerId)]: 0
      }
    },
    data: { event: 'pusher:pong', data: {} }
  }
     [Mon Feb 12 2024 13:52:04 GMT+0000 (Coordinated Universal Time)] ⚡ New message received:   
  { message: { event: 'pusher:ping', data: {} }, isBinary: false }
     [Mon Feb 12 2024 13:52:04 GMT+0000 (Coordinated Universal Time)] ✈ Sent message to client:   
  {
    ws: uWS.WebSocket {
      ip: '172.18.0.1',
      ip2: '',
      appKey: '85007e4a489a74a21006',
      sendJson: [Function (anonymous)],
      id: '2915440659.4987855848',
      subscribedChannels: Set(0) {},
      presence: Map(0) {},
      app: App {
        initialApp: [Object],
        server: [Server],
        enableUserAuthentication: false,
        hasClientEventWebhooks: false,
        hasChannelOccupiedWebhooks: false,
        hasChannelVacatedWebhooks: false,
        hasMemberAddedWebhooks: false,
        hasMemberRemovedWebhooks: false,
        hasCacheMissedWebhooks: false,
        id: '1750325',
        key: '85007e4a489a74a21006',
        secret: '0a1a6e9705f6d966cc43',
        maxConnections: -1,
        enableClientMessages: false,
        enabled: true,
        maxClientEventsPerSecond: -1,
        maxPresenceMembersPerChannel: 100,
        maxPresenceMemberSizeInKb: 2,
        maxChannelNameLength: 200,
        maxEventChannelsAtOnce: 100,
        maxEventNameLength: 200,
        maxEventPayloadInKb: 100,
        maxEventBatchSize: 10
      },
      timeout: Timeout {
        _idleTimeout: 120000,
        _idlePrev: [TimersList],
        _idleNext: [TimersList],
        _idleStart: 11108774,
        _onTimeout: [Function (anonymous)],
        _timerArgs: undefined,
        _repeat: null,
        _destroyed: false,
        [Symbol(refed)]: true,
        [Symbol(kHasPrimitive)]: false,
        [Symbol(asyncId)]: 23136,
        [Symbol(triggerId)]: 0
      }
    },
    data: { event: 'pusher:pong', data: {} }
  }

Am i doing something wrong?

0 likes
0 replies

Please or to participate in this conversation.