https://github.com/coderofsalvation/browserstream
Stream text to browser in realtime without using websockets using PHP
https://github.com/coderofsalvation/browserstream
Last synced: about 1 year ago
JSON representation
Stream text to browser in realtime without using websockets using PHP
- Host: GitHub
- URL: https://github.com/coderofsalvation/browserstream
- Owner: coderofsalvation
- Created: 2015-08-14T15:40:20.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2020-05-28T18:44:24.000Z (about 6 years ago)
- Last Synced: 2025-03-26T14:21:47.668Z (over 1 year ago)
- Language: PHP
- Size: 13.7 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
BrowserStream
=============
Stream text to browser in realtime without using websockets.
Think simple text progressbars, logging, longrunning tasks, terminal output etc.
## Usage
$ composer require coderofsalvation/BrowserStream
and then
Now go to your browser and you'll see 'loading' and dots being added every second OH MY! :)

Test it with curl like so:
$ curl -H "Accept: text/event-stream" -N -s "http://localhost/foo.php"
## Apache Gzip == no worky
Usually apache gzips the output of php.
This is not good if you want realtime output.
Therefore disable apache gzip buffering in .htaccess for a particular (realtime streaming) url like so:
RewriteRule ^(yoururl)$ $1 [NS,E=no-gzip:1,E=dont-vary:1]
## License
BSD