Local doesn’t work with Server-Side Events (SSE); I have tried both with Nginx and Apache. It might be the default server settings? If you find a way to make it work with SSE, a lot of users would be happy with this (lot of then don’t know the technical details but they need streaming for parts of their WordPress).
Thank you for coming and sharing your insight and script! I’ve changed your post to a Feature Request. So if other users are interested in making this more compatible with Local they can vote and comment. We use these to be able to gauge interest in future enhancements, so we appreciate the contribution!
Thank you! By the way, it works with Kinsta and their alternative to Local called “DevKinsta”. It also work with Siteground but doesn’t with WP Engine.
Many people will want this, though they don’t technically know what it means, they will never ever vote for this here, but they will switch hosting service based on recommendations; for example, if it doesn’t work with Flywheel, I will have to recommend another hosting for the users of my plugin (currently 30,000 users). Please consider it, it’s not only a feature for Local, it’s more.
Thanks Jordy to think about all the users who are just managing through Please, make it work widely on various hosts… just to think about the hassle to change host I want to cry… But would certainly do it nonetheless!
Again thanks for all your plugins, and more particularly AI Engine and its developments.
Helene
Hey @TigrouMeow - thanks for starting this feature request!
The engineering team talked it over, and this is possible in Local today. The nginix configuration just needs to be updated and you’re good to go. Here are the steps we took to see it working:
Using Site Domains router mode in Local, Create a new site
Add your sse.php script to ~/Local Sites/sitename/app/public/sse.php
Navigate to that script in the browser: http://sitename.local
Note that the script waits for a bit, then outputs all the numbers. The intended behavior is to have each number show up one at a time, about a second apart
Edit /Applications/Local.app/Contents/Resources/extraResources/router-config/nginx.conf and add the below nginx config lines: proxy_set_header Connection ''; proxy_http_version 1.1;
Quit Local and restart it (this regenerates the router config file)
Navigate to the script again in the browser (http://sitename.local) and note that the numbers come in, one at a time.
We can evaluate changing this default behavior, but we’ll have to do some research on any potential side effects… the good news is that with some quick changes, users can have this working in Local pretty easily!
Thank you! It’s awesome Normally, it shouldn’t affect anything else, except streaming (which, let’s be honest, is rarely used with PHP). But it works! I also heard from one of my users that you cab also deploy this change for specific users of Flywheel, which is really cool. WPEngine is a bit behind on this though, you are way more reactive haha! (apparently it’s not the same team)
Ha, it is a big company! But we’ll follow up with our friends on the WP Engine platform and see what we can do.
I was doing some additional troubleshooting on this, just because I was curious. I did find that if your site is in localhost mode (as opposed to site domains), it seems SSE works out of the box without any changes (although, I’m not 100% sure why)… but it was working for me! Please pass this along to your users if they’re asking
We’ll keep digging on that change as a default. Thanks for bringing this to our attention!