https://github.com/captainerd/swoolestatic
Class for using Gzip compression and serving a public htdocs dir
https://github.com/captainerd/swoolestatic
Last synced: 9 days ago
JSON representation
Class for using Gzip compression and serving a public htdocs dir
- Host: GitHub
- URL: https://github.com/captainerd/swoolestatic
- Owner: captainerd
- Created: 2019-11-23T06:01:23.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-24T13:48:13.000Z (about 3 years ago)
- Last Synced: 2025-07-19T00:41:31.223Z (11 months ago)
- Language: PHP
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Class that provides the following for the swoole PHP extension:
Handle the static files-directory.
Use gzip compression when that is possible (if the client/browser accepts)
The httpd.php starts a websocket server along with the web, at both ports 80 and SSL 443.
Useage examples:
//SendResponse(String, Mime-type, Status-code)
$httpSrv->SendResponse(json_encode($resp), 'json', 200); OR $httpSrv->SendResponse('not found', 'txt', 404);
-
//making a directory public for static-serving
$httpSrv->handleRequest('./htdocs');