Symfony : how to launch Mercury elsewhere than locally?

  mercure, ngrok, php, symfony

in my Symfony project I am using Mercury.

Currently, locally, to launch Mercury, I use the following command:

./mercure/mercure --jwt-key='mySecretKey' --addr='localhost:3000' --allow-anonymous --cors-allowed-origins='*'

So, I’m using the port 3000 of my localhost : localhost:3000.

But how am I supposed to do it once in production?

To test elsewhere than locally, I used ngrok, which allows me to have an address to use my application elsewhere than locally:

http://[ngrokID].ngrok.io

But for the mercure service ? http://[ngrokID].ngrok.io:3000 ?
So : ./mercure/mercure --jwt-key='mySecretKey' --addr='[ngrokID].ngrok.io:3000' --allow-anonymous --cors-allowed-origins='*'

If I test like this, I’ve this error :

enter image description here

Source: Symfony Questions

LEAVE A COMMENT