forked from jefyokta/kamela2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
54 changed files
with
766 additions
and
5,122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace Kamela\Websocket; | ||
|
||
use Swoole\Coroutine; | ||
use Swoole\Table; | ||
use Swoole\WebSocket\Frame; | ||
use Swoole\WebSocket\Server; | ||
|
||
class Notification | ||
{ | ||
|
||
|
||
public static function handle(Server $server, Frame $frame, Table $table) | ||
{ | ||
|
||
$data = $frame->data; | ||
|
||
$message = json_decode($data); | ||
|
||
foreach ($table as $fd => $row) { | ||
$details = json_decode($row['details']); | ||
if ($details->isAdmin === 1) { | ||
if ($server->exists($fd)) { | ||
$server->push($fd, json_encode(["message" => $message->message, "guestName" => $message->guestName, "houseId" => $message->houseId])); | ||
} | ||
} | ||
} | ||
$server->push($frame->fd, json_encode($data)); | ||
} | ||
|
||
|
||
public static function house(Server $server, Frame $frame, Table $table) | ||
{ | ||
$data = json_decode($frame->data); | ||
|
||
foreach ($server->connections as $fd) { | ||
|
||
$server->push($fd, json_encode(["event" => "houseUpdate", "house" => [ | ||
"id" => $data->id, | ||
"status" => $data->status | ||
]])); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## Usage | ||
this certificate is sign for host kamela-permai.oktaa, so: | ||
|
||
- add kamela-permai.oktaa to your hosts files | ||
- trust the ca file: jefyokta-cert.pem for your device | ||
|
||
congratulations, now you can use https://kamela-permai.oktaa with valid certfificate |
Oops, something went wrong.