Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Websocket: if there's an internal BIND address, it's most likely the …
Browse files Browse the repository at this point in the history
…address the php server will have to connect to. Added a Todo to handle REST auth.
  • Loading branch information
cdujeu committed Dec 18, 2015
1 parent 7c4c76c commit d19bc7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/plugins/core.mq/class.MqManager.php
Expand Up @@ -181,7 +181,7 @@ public function sendInstantMessage($xmlContent, $repositoryId, $targetUserId = n
$input = serialize($input);
$msg = WebSocketMessage::create($input);
if (!isset($this->wsClient)) {
$this->wsClient = new WebSocket("ws://".$configs["WS_SERVER_HOST"].":".$configs["WS_SERVER_PORT"].$configs["WS_SERVER_PATH"]);
$this->wsClient = new WebSocket("ws://".$configs["WS_SERVER_BIND_HOST"].":".$configs["WS_SERVER_BIND_PORT"].$configs["WS_SERVER_PATH"]);
$this->wsClient->addHeader("Admin-Key", $configs["WS_SERVER_ADMIN"]);
@$this->wsClient->open();
}
Expand Down
4 changes: 4 additions & 0 deletions core/src/plugins/core.mq/ws-server.php
Expand Up @@ -98,6 +98,10 @@ public function onConnect(IWebSocketConnection $user)
}

$h = $user->getHeaders();
/*
* @todo
* Handle a REST auth instead of cookie based.
*/
$c = WebSocketFunctions::cookie_parse($h["Cookie"]);

$client = new HttpClient($this->host);
Expand Down

0 comments on commit d19bc7b

Please sign in to comment.