mercure | efficient solution for real-time communications | Websocket library
kandi X-RAY | mercure Summary
kandi X-RAY | mercure Summary
Mercure is a protocol allowing to push data updates to web browsers and other HTTP clients in a convenient, fast, reliable and battery-efficient way. It is especially useful to publish async and real-time updates of resources served through web APIs, to reactive web and mobile apps. The protocol has been published as an Internet Draft that is maintained in this repository. A reference, production-grade, implementation of a Mercure hub (the server) is also available in this repository. It's a free software (AGPL) written in Go. It is provided along with a library that can be used in any Go application to implement the Mercure protocol directly (without a hub) and an official Docker image. In addition, a managed and high-scalability version of the Mercure.rocks hub is available on Mercure.rocks.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mercure
mercure Key Features
mercure Examples and Code Snippets
Community Discussions
Trending Discussions on mercure
QUESTION
I installed mercure using the following command as stated in the documentation:
composer require mercure
After that, i'm supposed to start the mercure server and here is the issue: how?
Symfony's documentation doesn't state that.
Mercure's documentation also doesn't state anything about it, especially using a config file generated in /config/packages/mercure.yaml
.
What i've found is that i need to download a separate binary (for my specific platform) and then i'm supposed to start the server from Powershell using the following:
.\/bin/mercure run
However, if i try to pass -envfile ".env"
, then it doesn't even try to use any of the variables inside.
On top of that, it doesn't seem to be using any environment variables at all, even ones i've defined in cmd.
There are other things like how do i allow CORS, as there isn't something i can change in my config file, it isn't an argument i can pass to the binary and i can't add it as an environment variable.
if i ever try to subscribe to the event (which is done on port 2019 cause of the previous issues), 404 and CORS is returned.
also this is what i get with just .\/bin/mercure run
:
My .env
:
Right now i'm wondering how am i supposed to use mercure, i've looked at a couple videos for symfony 5.4 and they basically either are on linux and it somehow work for them OR It's marked as outdated cause of configs changes, syntax changes and others...
The documentation also doesn't help at all in that regard which kind of make me regret trying to use mercure.
EDIT:
I was told to try fiddling with Caddy configs, but it doesn't seem like mercure is trying to use those either, even tried specifying the config with -config
.
Result:
- Port not set to 3000
- No allow_cors header
Caddyfile:
...ANSWER
Answered 2022-Apr-01 at 11:50I will give you an example of mercure running over windows without use of Docker, sorry for my english ok?!!
I will start from an installation of symfony 5.4 with a SSL virtual host: https://myshop.local and MercureBundle.
The goal is to notify for example, to all authenticated users when a new product enter on a shop stock.
First: the mercure hub and your site must run over the same domain or subdomain, in other case isn't possible to share the auth cookie; so our mercure hub will run on https://myshop.local:3000 (the same domain, but another port, check your firewall)
Second: It's neccesary to set the appropiates environment variables, so in your .env.local
:
QUESTION
I am contacting you because I can't get mercure to work in production.
The binary prebuild runs fine, but when I try to connect to the hub, I get a 404 no found.
Here is the command I run :
...ANSWER
Answered 2022-Feb-20 at 11:26That is my apache settings. Maybe help to you.
open nano /etc/apache2/sites-available/yourdomain.com-le-ssl.conf
QUESTION
I am having an issue sending updates to the Caddy-based Mercure Hub with both the Symfony Mercure\HubInterface and the "pure" PHP example.
When attempting to publish an update (following the official Symfony/Mercure tutorial), I get the error "Failed to send an update", with the TransportException:
"SSL certificate problem: unable to get local issuer certificate for "https://localhost/.well-known/mercure".
When trying to publish with the "pure" PHP example: https://github.com/dunglas/mercure/blob/main/examples/publish/php.php
I get the error:
"Warning: file_get_contents(https://localhost/.well-known/mercure): Failed to open stream: operation failed in /"path"/test.php on line 13"
Everything works when I run the CURL example (https://mercure.rocks/docs/getting-started) in Terminal:
...ANSWER
Answered 2022-Feb-14 at 15:18try add in framework.yaml
QUESTION
I'm using the package: https://www.npmjs.com/package/react-native-sse
I can't manage to receive events from the server in android even though I copy paste the code from the documentation.
...ANSWER
Answered 2021-Sep-18 at 14:48This is the reason: https://github.com/facebook/flipper/issues/2495
Solution 1:in the reactNativeFlipper.java, the following lines making EventSource (SSE) not working.
- go to android/app/src/debug/java/com/iwaiterapp/ReactNativeFlipper.java
- comment NetworkFlipperPlugin like this:
QUESTION
Hello i have a Planet class like below and i want to display Enum like MERCURY EARTH Etc ... without the informations between parenthesis and i'm using the CommonName inside the parenthesis like MERCURE , TERRE to search and display the Enum
...ANSWER
Answered 2021-Nov-12 at 01:58When printing the enum value directly, as you have found it prints information along with it. If you just want the name of the enum, e.g. "MARS", try using the name
method, which returns a string of name.
Example: System.out.println(Dept.get().name());
QUESTION
For my personal development, I try using this repo https://github.com/dunglas/symfony-docker as Docker base to create a PHP 8/Symfony 5 environnement.
I could launch my App on https://localhost, updating my project is reflected on browser. But I got a weird thing with Doctrine. Actually, I could update my database schema using Symfony command bin/console doctrine:schema:update --force
, using Doctrine Migrations or insert data using command too. But, when I try to find/save data within my Symfony app, there is no result when I find and no data insert on create/update.
Here is my docker-compose.yml (almost same as repo, only database > volumes change):
...ANSWER
Answered 2021-Oct-16 at 17:35You must call flush on the Doctrine entity manager after a persist:
QUESTION
I know this question has been asked many times:
- Caddy - How to disable https only for one domain
- Disable caddy ssl to enable a deploy to Cloud Run through Gitlab CI
- Caddy - Setting HTTPS on local domain
- How can I disable TLS when running from Docker?
- How to serve both http and https with Caddy?
but here is my problem.
SetupI created a new Api Platform project following their documentation.
The easiest and most powerful way to get started is to download the API Platform distribution
I downloaded the release 2.5.6 in which we can find:
- a docker-compose
- a Dockerfile
- a Caddyfile
- and many others files.
I slightly change the docker compose file by removing the pwa service and PostgreSQL:
...ANSWER
Answered 2021-Sep-15 at 12:11I found a solution here:
https://github.com/caddyserver/caddy/issues/3219#issuecomment-608236439
CaddyfileQUESTION
I have a problem that I don't understand at all. Somebody knows how to solve this problem and why it happens?
...yaml: line 9: did not find expected tag URI
ANSWER
Answered 2021-Aug-26 at 14:24when you change the value of !ChangeMe!
with something that don't start with !
it should work.
Best regards, Daniel
QUESTION
I am using mercure from the symfony binary. After setting up a new project via
...ANSWER
Answered 2021-Aug-25 at 08:23It turns out that it was a problem with the configuration on my operating system. After pushing the project onto another machine, everything worked fine.
QUESTION
I am trying to deploy my Mercure server on a Heroku app
I downloaded a Linux version of Mercure and extract it and I added this procfile
to it:
ANSWER
Answered 2021-Aug-20 at 08:26In order to deploy Mercure binary on Heroku, you need to use a Binary Buildpack.
I suggest this one: https://github.com/ph3nx/heroku-binary-buildpack
After creating a new app on Heroku, you can set that buildpack using buildpacks:set
Run this command:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install mercure
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page