English 中文(简体)
Pusher误差:cURL差错 7: 未能连接到127.0.0.1港6001: 拒绝联系
原标题:Pusher error: cURL error 7: Failed to connect to 127.0.0.1 port 6001: Connection refused

I m 提出单独的Laravel 10和Vue3的申请。 我想用拉拉维尔广播开展实时活动,但我会遇到一些问题。

我从前线接通了网页,但我没有看到任何东西,而且当我试图从后台引发事件时,我会发现库勒的错误。

BACKEND LARAVEL

网址:php

` apps  => [
        [
             id  => env( PUSHER_APP_ID ),
             name  => env( APP_NAME ),
             key  => env( PUSHER_APP_KEY ),
             secret  => env( PUSHER_APP_SECRET ),
             path  => env( PUSHER_APP_PATH ),
             capacity  => null,
             enable_client_messages  => false,
             enable_statistics  => true,
        ],
    ],`

广播。 php


 pusher  => [
             driver  =>  pusher ,
             key  => env( PUSHER_APP_KEY ),
             secret  => env( PUSHER_APP_SECRET ),
             app_id  => env( PUSHER_APP_ID ),
             options  => [
                 cluster  => env( PUSHER_APP_CLUSTER ),
                 encrypted  => false,
                 host  =>  127.0.0.1 ,
                 port  => 6001,
                 scheme  =>  http ,
                 useTLS  => false
            ],
        ],

.env (laravel)

BROADCAST_DRIVER=pusher
QUEUE_CONNECTION=sync
PUSHER_APP_ID=local
PUSHER_APP_KEY=local
PUSHER_APP_SECRET=local
PUSHER_APP_CLUSTER=eu
PUSHER_SCHEME=http

in api.php

/**
 * Live EVENTS
 */
Route::get( /test , function () {
    event(new UpdateUser());
});

活动/最新情况

class UpdateUser implements ShouldBroadcast
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    public function __construct()
    {
    }

    public function broadcastWith(): array
    {
        return [ message  =>  Hello, Vue! ];
    }

    public function broadcastOn(): Channel
    {
        return new Channel( userupdate-channel );
    }
}

页: 1


 providers  => ServiceProvider::defaultProviders()->merge([
        /*
         * Package Service Providers...
         */

        /*
         * Application Service Providers...
         */
        AppProvidersAppServiceProvider::class,
        AppProvidersAuthServiceProvider::class,
        AppProvidersBroadcastServiceProvider::class,
        AppProvidersEventServiceProvider::class,
        AppProvidersRouteServiceProvider::class,
    ])->toArray(),

FRONTEND VUE

.env

VITE_PUSHER_APP_KEY=local
VITE_PUSHER_APP_HOST= 127.0.0.1 
VITE_PUSHER_CLUSTER= eu 

主编js

//Laravel Notifications
import Echo from  laravel-echo 
import Pusher from  pusher-js ;
window.Pusher = Pusher

window.Echo = new Echo({
    broadcaster:  pusher ,
    key: import.meta.env.VITE_PUSHER_APP_KEY,
    cluster:  eu ,
    wsHost: import.meta.env.VITE_PUSHER_APP_HOST,
    wsPort: 6001,
    forceTLS: false,
    encrypted: false,
    disableStats: true,
    enabledTransports: [ ws ],
    //enabledTransports: [ ws ,  wss ],
})

The versions i used: "pusher-js": "^4.3.1", "laravel-echo": "^1.15.3",

前线:

https://i.stack.imgur.com/ipa2q.png” rel=“nofollow noreferer”>。

我在当地开发土地。

问题回答

我发现与Laravel 11和10 Breeze与推土公司合作的唯一事情是把你的环境改变到网上。 页: 1

curl.cainfo =C:Users opathcacert.pem openssl.cafile=C:UsersDaveMannopensslcacert.pem

console.logprofile in browser: f12->levels->verbose

如果你使用集装箱试图改变您的东道方,以您的袖珍集装箱为名:

PUSHER_HOST=socket # using docker. default is localhost

and

VITE_PUSHER_HOST="127.0.0.1" # using docker. default is ${REVERB_HOST}




相关问题
correct socket.io implementation

I m trying out socket io for my project to show online friends, and I was wondering (actually, it looks kinda strange to me) that whenever I try to rerender the page (it doesn t matter if a user ...

缩略语

我可以把我们的网页连接起来,使用轮椅。

WebSocket stress testing

I would like to do some stress testing to a WebSocket based application. Anyone knows a tool that may help me in this task? Update: I forgot to mention, but I m favoring open source or free tools, ...

Web Sockets - server load

I m trying to learn new technology called Web Sockets. I ve got the setup (pywebsocket as Apache2 module) working and I m playing with examples. http://code.google.com/p/websocket-sample/wiki/samples?...

Web sockets server side processing model

To implement a server supporting clients using web sockets, do servers keep an open HTTP connection with each client? How can this scale? What are the "programming models" when implementing this ...

Will html5 websockets be crippled by firewalls?

I m extremely excited about html5 s websockets spec but I have a concern. These days everyone is operating off of some network, with routers (wired/wireless) that have built in firewalls, windows has ...

ColdFusion Socket Gateway

What is the performance like on a Socket Gateway for CF? EDIT : I meant to ask, given the way its built is it suitable for large scale applications or just demo purposes? I.e 2000+ users being ...

热门标签