mercure | efficient solution for real-time communications | Websocket library

 by   dunglas Go Version: v0.14.10 License: AGPL-3.0

kandi X-RAY | mercure Summary

kandi X-RAY | mercure Summary

mercure is a Go library typically used in Networking, Websocket applications. mercure has no bugs, it has no vulnerabilities, it has a Strong Copyleft License and it has medium support. You can download it from GitHub.

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

            kandi-support Support

              mercure has a medium active ecosystem.
              It has 3393 star(s) with 252 fork(s). There are 61 watchers for this library.
              There were 8 major release(s) in the last 12 months.
              There are 15 open issues and 386 have been closed. On average issues are closed in 102 days. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of mercure is v0.14.10

            kandi-Quality Quality

              mercure has 0 bugs and 0 code smells.

            kandi-Security Security

              mercure has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              mercure code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              mercure is licensed under the AGPL-3.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              mercure releases are available to install and integrate.
              It has 5699 lines of code, 281 functions and 55 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mercure
            Get all kandi verified functions for this library.

            mercure Key Features

            No Key Features are available at this moment for mercure.

            mercure Examples and Code Snippets

            No Code Snippets are available at this moment for mercure.

            Community Discussions

            QUESTION

            Symfony 5.4 - How am i supposed to properly start mercure using symfony
            Asked 2022-Apr-01 at 11:50

            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:50

            I 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:

            Source https://stackoverflow.com/questions/71683027

            QUESTION

            Run Mercure on production : 404 no found
            Asked 2022-Feb-21 at 15:19

            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:26

            That is my apache settings. Maybe help to you.

            open nano /etc/apache2/sites-available/yourdomain.com-le-ssl.conf

            Source https://stackoverflow.com/questions/71131249

            QUESTION

            Symfony Mercure "Failed to send an update"
            Asked 2022-Feb-14 at 15:18

            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:18

            try add in framework.yaml

            Source https://stackoverflow.com/questions/71082649

            QUESTION

            React native can't connect to SSE in android
            Asked 2021-Dec-31 at 02:38

            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:48

            This is the reason: https://github.com/facebook/flipper/issues/2495

            in the reactNativeFlipper.java, the following lines making EventSource (SSE) not working.

            Solution 1:
            • go to android/app/src/debug/java/com/iwaiterapp/ReactNativeFlipper.java
            • comment NetworkFlipperPlugin like this:

            Source https://stackoverflow.com/questions/69235694

            QUESTION

            How can i display an enum without all informations
            Asked 2021-Nov-12 at 02:09

            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:58

            When 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());

            Source https://stackoverflow.com/questions/69936995

            QUESTION

            Why I can find/save from command line but not in my Symfony app?
            Asked 2021-Oct-17 at 09:39

            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:35

            You must call flush on the Doctrine entity manager after a persist:

            Source https://stackoverflow.com/questions/69594888

            QUESTION

            Caddy allow HTTP with Api Platform
            Asked 2021-Sep-15 at 12:11

            I know this question has been asked many times:

            1. Caddy - How to disable https only for one domain
            2. Disable caddy ssl to enable a deploy to Cloud Run through Gitlab CI
            3. Caddy - Setting HTTPS on local domain
            4. How can I disable TLS when running from Docker?
            5. How to serve both http and https with Caddy?

            but here is my problem.

            Setup

            I 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:

            docker-compose

            I slightly change the docker compose file by removing the pwa service and PostgreSQL:

            ...

            ANSWER

            Answered 2021-Sep-15 at 12:11

            QUESTION

            Docker Compose : yaml: line 9: did not find expected tag URI
            Asked 2021-Aug-26 at 14:24

            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:24

            when you change the value of !ChangeMe! with something that don't start with ! it should work.

            Best regards, Daniel

            Source https://stackoverflow.com/questions/68938697

            QUESTION

            Mercure/Symfony: Authorization Error with JWT Key
            Asked 2021-Aug-25 at 08:23

            I am using mercure from the symfony binary. After setting up a new project via

            ...

            ANSWER

            Answered 2021-Aug-25 at 08:23

            It turns out that it was a problem with the configuration on my operating system. After pushing the project onto another machine, everything worked fine.

            Source https://stackoverflow.com/questions/68861691

            QUESTION

            How to deploy Mercure Binary on heroku?
            Asked 2021-Aug-20 at 08:54

            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:26

            In 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:

            Source https://stackoverflow.com/questions/68856744

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install mercure

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Websocket Libraries

            netty

            by netty

            ws

            by websockets

            websocket

            by gorilla

            websocketd

            by joewalnes

            koel

            by koel

            Try Top Libraries by dunglas

            vulcain

            by dunglasGo

            frankenphp

            by dunglasGo

            react-esi

            by dunglasTypeScript

            doctrine-json-odm

            by dunglasPHP

            DunglasActionBundle

            by dunglasPHP