phpi-websocket
Scaffoldigaddemoforiteractigwithphpiviawebsockets.
ThisshouldbeeoughtogetstartedwithaWSserveradcliet.Theicludeddemowillletyoumoitorthepiheaders,selectalteratefuctiosadchagepilevels.
IstalatioIstallatioshouldbedoeusigcomposerasthereareafewdepedecies(especiallyforratchet-sorryaboutthisbuttheyarealljusttiysymphoycompoets).
Ifyoudo'thavecomposeralready:
$curl-sShttps://getcomposer.org/istaller|php
Theistall
$./composer.pharcreate-projectcalciai/phpi-websocket
Alteratively,youcadowloadthecurretreleasewithallitsdepedeciesfromthereleasespage.
UsageYoucatesttheserverbyruig
phpexamples/server.php
ThiswillruasimpleHTTP&WebSocketserveroport9999.Ifthehostameofthepiisotthedefault(raspberrypi.local),you'lleedtosetittosomethigthatcabeaccessediserver.php
Allgoigwell,youshouldbeabletoaccesstheexampleathttps://raspberrypi.local:9999/adseesomethiglikethis:











评论