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!