Skip to content

Is it possible to connect Pysher to a Laravel-Websockets server #61

@SpicerSolutions

Description

@SpicerSolutions

Hello,

I'm tried to refactor a project away from using Pusher to Laravel-Websockets.

Has anyone tried this or had any success, I'm trying the following

def init_channel_join(self):
    print('init channel join')
    self.clientPusher = pysher.Pusher(self.app_key, cluster=self.app_cluster, log_level=logging.DEBUG, custom_host="www.projectwebsite.com", port=6001)
    self.clientPusher.connection.bind('pusher:connection_established', self.connect_handler)
    self.clientPusher.connect()

def connect_handler(self, data):
    print('connected')
    self.channel = self.clientPusher.subscribe(self.data_channel)
    print('subscribed')
    print('binding')
    self.channel.bind('App\\Events\\update', self.pusher_callback)

def pusher_callback(self, message):
    print(data)

I get a 'init channel join' message but it never connects, I'm wondering if I'm doing something wrong or whether the laravel-websocket (Pusher drop in replacement) is just the wrong protocol or something else entirely.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions