Skip to content

Commit

Permalink
Faster demasking
Browse files Browse the repository at this point in the history
  • Loading branch information
Devristo committed Dec 26, 2011
1 parent 6d59338 commit 2b95f95
Show file tree
Hide file tree
Showing 11 changed files with 1,810 additions and 1,777 deletions.
98 changes: 49 additions & 49 deletions phpws/websocket.admin.php
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
<?php
require_once("websocket.client.php");

class WebSocketAdminClient extends WebSocket{
protected $adminKey = null;

public function __construct($url, $adminKey){
parent::__construct($url);

$this->adminKey = $adminKey;

$this->addHeader("Admin-Key", $adminKey);
}


public function sendMessage(WebSocketAdminMessage $msg){
$wsmsg = WebSocketMessage::create(json_encode($msg));

parent::sendMessage($wsmsg);
}
}

/**
* Helper class to send Admin Messages to the WebSocketServer
*
* Makes the server execute onAdminXXXX() events
*
* @author Chris
*
*/
class WebSocketAdminMessage extends stdClass{
public $task = null;

private function __construct(){

}

/**
* Create a message that will be send to the instance of the WebSocketServer
*
* @param string $task
* @return WebSocketAdminMessage
*/
public static function create($task){
$o = new self();
$o->task = $task;

return $o;
}
<?php
require_once("websocket.client.php");

class WebSocketAdminClient extends WebSocket{
protected $adminKey = null;

public function __construct($url, $adminKey){
parent::__construct($url);

$this->adminKey = $adminKey;

$this->addHeader("Admin-Key", $adminKey);
}


public function sendMessage(WebSocketAdminMessage $msg){
$wsmsg = WebSocketMessage::create(json_encode($msg));

parent::sendMessage($wsmsg);
}
}

/**
* Helper class to send Admin Messages to the WebSocketServer
*
* Makes the server execute onAdminXXXX() events
*
* @author Chris
*
*/
class WebSocketAdminMessage extends stdClass{
public $task = null;

private function __construct(){

}

/**
* Create a message that will be send to the instance of the WebSocketServer
*
* @param string $task
* @return WebSocketAdminMessage
*/
public static function create($task){
$o = new self();
$o->task = $task;

return $o;
}
}
Loading

0 comments on commit 2b95f95

Please sign in to comment.