Added method to access request from connection
This commit is contained in:
parent
1c9d8a4a05
commit
2cf95fcc85
@ -165,6 +165,11 @@ class WebSocketConnection implements WebSocketInterface
|
||||
return $this->group;
|
||||
}
|
||||
|
||||
public function getServerRequest(): ServerRequestInterface
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
|
||||
public function getRemoteAddress()
|
||||
{
|
||||
return $this->request->getServerParams()['REMOTE_ADDR'];
|
||||
|
@ -25,4 +25,6 @@ interface WebSocketInterface extends ConnectionInterface
|
||||
|
||||
public function closeWithReason(string $reason, int $code=1000);
|
||||
|
||||
public function getServerRequest(): ServerRequestInterface;
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user