Example #1
0
 public function setOrigin($origin)
 {
     Request::setDefaultHeader('Origin', $origin);
     return $this;
 }
Example #2
0
 /**
  * @return Request
  */
 private function sendUpgradeRequest()
 {
     $this->websocket_key = self::generateKey();
     $request = new Request();
     $request->setURI($this->client->getURI());
     $request->setHeader('Connection', 'Upgrade');
     $request->setHeader('Sec-WebSocket-Key', $this->websocket_key);
     $request->setHeader('Sec-WebSocket-Version', 13);
     $request->setHeader('Upgrade', 'websocket');
     $this->stream->write($request->toString());
 }