Skip to content

[bug] proxy connect with SubscribeOptions not working v5.4.4 #873

Closed
@morya

Description

Describe the bug.

SubscribeOptions field from connect proxy response, is not working.

version: v5.4.4

Centrifugo version isv5.4.4
Client library used is github.com/centrifugal/centrifuge v0.33.1-0.20240801054640-96afa7258679
Operating system is macos

Steps to Reproduce How can the bug be triggered?

with config.yaml for centrifugo like this:

proxy_connect_endpoint: http://192.168.1.1:8080/centrifugo-connect  # this is the python fastapi address
proxy_connect_timeout:  "2s"

Expected behavior What output or behaviour were you expecting instead?

join/leave events been emitted.

Code Snippets A minimum viable code snippet can be useful.

I use fastapi to be centrifugo proxy-handler.

# coding:utf8

import secrets

from pydantic import BaseModel
from fastapi import FastAPI


app = FastAPI()


class ReqCentConnect(BaseModel):
    client: str
    transport: str
    protocol: str
    name: str
    data: object
    

@app.post("/centrifugo-connect")
async def on_connect(req: ReqCentConnect):
    # uid = secrets.token_hex(4)
    uid = req.client.split("-")[0]
    return {
        "result": {
            "user": uid,
            "data": {
                    "logo": "abc.png",
            },
            "channels": ["room"],
            "subs": {
                "room": {
                    "override": {
                        "presence": {
                            "value": True,
                        },
                        "join_leave": {
                            "value": True,
                        },
                        "force_push_join_leave": {
                            "value": True,
                        },
                    },
                },
            }
        }
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions