-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to use this outside symfony? #96
Comments
Hi, this library is totally standalone and doesn't need the rest of the Symfony framework. By the way it is used by modules targeting other frameworks, for instance Laravel: https://github.com/mvanduijker/laravel-mercure-broadcaster You have an example of how to use this library without a framework in the Cheers! |
Thanks for getting back to me. The readme says I only need the mercure hub url and jwt, but the library's symfony docs advices the use of cookies. I can't access the hub without the token provider/jwt (are both to be combined or is there an undocumented provider for cookies?) So, I've found documentation for the roadrunner broadcasting plugin. It seems to be missing authorisation capabilities that this mercure library does but I don't seem to be making much headway combining both. Nevertheless, I'll appreciate if you can clear the air regarding questions in the previous paragraph. Otherwise, please close the issue. I will refer users of my framework to this extra server if their needs include channel authorisation I checked the laravel repo but they rolled out a more complicated method for everything (the cookie and jwt bindings, for instance), than the original. I think abstractions should be easier than what they build upon An unrelated question: do you mind explaining the difference or importance of this 2?
Are they relevant to me, as I'm not using twig? If yes, how do they fit into the programmatic invocation? My expected flow would've been on client connect, it opens the event source object with a list of topics it wants to subscribe to. It then sends a http request to a controller, where a decision is made whether or not this client is authorised to join (this way, data can be published safely to all members). Perhaps, the jwt/cookie from this endpoint would include list of authorised topics under the subscribe key? What about publish? |
From the docs, it says that the server is to be configured from a "config/packages/mercure.php" file. I imagine this file will need to be booted by the symfony framework, which my project doesn't have. My own project uses a Roadrunner server, and they provide a configuration entry for triggering setup of a websocket server. I imagine it'll be convenient if there is a way to pass the roadrunner websocket url to the symfony mercure library, but without the symfony framework. Kindly correct my expected flow if it's wrong but these are the variables available to me
The text was updated successfully, but these errors were encountered: