Added method to access request from connection
This commit is contained in:
1 parent
1c9d8a4a05
commit
2cf95fcc85
2 files changed
+7
No files matched your search
@@ -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;
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user