使用 Laravel websockets 连接到 Pusher 时出现问题(cURL 错误代码 6)

问题描述 投票:0回答:0

朋友们有美好的一天 我遇到了一个我无法解决的问题,谢谢你帮我解决了这个问题。 我打算使用 Laravel websocket 开发网站的通知部分但是在发送事件后,我收到以下错误: Error image

Illuminate\Broadcasting\BroadcastException
Pusher error: cURL error 6: Could not resolve host: eu (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://eu/apps/xxx/events?auth_key=xxx&auth_timestamp=xxx&auth_version=1.0&body_md5=xxx&auth_signature=xx.

配置文件broadcasting.php的内容: config/broadcasting.php

'connections' => [

    'pusher' => [
        'driver' => 'pusher',
        'key' => env('PUSHER_APP_KEY'),
        'secret' => env('PUSHER_APP_SECRET'),
        'app_id' => env('PUSHER_APP_ID'),
        'options' => [
            'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
            'port' => env('PUSHER_PORT', 443),
            'scheme' => env('PUSHER_SCHEME', 'https'),
            'encrypted' => true,
            'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
        ],
    ],  
],

和 .env 文件: .env

PUSHER_APP_ID=xxxxxxx
PUSHER_APP_KEY=xxxxxxxxxxxxxx
PUSHER_APP_SECRET=xxxxxxxxxxxxxxx
PUSHER_HOST=eu
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1

nslookup Command

Ping Command

如果有人能帮助我,我将不胜感激。

php laravel libcurl php-curl laravel-websockets
© www.soinside.com 2019 - 2024. All rights reserved.