mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
Add the ability to log users and their shared subdomains
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Contracts\StatisticsCollector;
|
||||
use App\Contracts\SubdomainGenerator;
|
||||
use App\Http\QueryParameters;
|
||||
use App\Server\Exceptions\NoFreePortAvailable;
|
||||
use App\Contracts\LoggerRepository;
|
||||
use Ratchet\ConnectionInterface;
|
||||
use React\EventLoop\LoopInterface;
|
||||
use React\Socket\Server;
|
||||
@@ -28,11 +29,15 @@ class ConnectionManager implements ConnectionManagerContract
|
||||
/** @var StatisticsCollector */
|
||||
protected $statisticsCollector;
|
||||
|
||||
public function __construct(SubdomainGenerator $subdomainGenerator, StatisticsCollector $statisticsCollector, LoopInterface $loop)
|
||||
/** @var LoggerRepository */
|
||||
protected $logger;
|
||||
|
||||
public function __construct(SubdomainGenerator $subdomainGenerator, StatisticsCollector $statisticsCollector, LoggerRepository $logger, LoopInterface $loop)
|
||||
{
|
||||
$this->subdomainGenerator = $subdomainGenerator;
|
||||
$this->loop = $loop;
|
||||
$this->statisticsCollector = $statisticsCollector;
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
public function limitConnectionLength(ControlConnection $connection, int $maximumConnectionLength)
|
||||
@@ -67,6 +72,8 @@ class ConnectionManager implements ConnectionManagerContract
|
||||
|
||||
$this->statisticsCollector->siteShared($this->getAuthTokenFromConnection($connection));
|
||||
|
||||
$this->logger->logSubdomain($storedConnection->authToken, $storedConnection->subdomain);
|
||||
|
||||
return $storedConnection;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user