-
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Foundational refactor to allow for HTTP/3
- Loading branch information
Showing
16 changed files
with
196 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Amp\Http\Server\Driver; | ||
|
||
use Amp\Http\Server\Driver\Internal\ConnectionHttpDriver; | ||
use Amp\Http\Server\Driver\Internal\QPack; | ||
use Amp\Http\Server\ErrorHandler; | ||
use Amp\Http\Server\Request; | ||
use Amp\Http\Server\RequestHandler; | ||
use Amp\Http\Server\Response; | ||
use Amp\Quic\QuicConnection; | ||
use Amp\Socket\Socket; | ||
use Psr\Log\LoggerInterface as PsrLogger; | ||
|
||
class Http3Driver extends ConnectionHttpDriver | ||
{ | ||
private bool $allowsPush; | ||
|
||
public function __construct( | ||
RequestHandler $requestHandler, | ||
ErrorHandler $errorHandler, | ||
PsrLogger $logger, | ||
private readonly int $streamTimeout = Http2Driver::DEFAULT_STREAM_TIMEOUT, | ||
private readonly int $headerSizeLimit = Http2Driver::DEFAULT_HEADER_SIZE_LIMIT, | ||
private readonly int $bodySizeLimit = Http2Driver::DEFAULT_BODY_SIZE_LIMIT, | ||
private readonly bool $pushEnabled = true, | ||
private readonly ?string $settings = null, | ||
) { | ||
parent::__construct($requestHandler, $errorHandler, $logger); | ||
|
||
$this->allowsPush = $pushEnabled; | ||
|
||
$this->qpack = new QPack; | ||
} | ||
|
||
protected function write(Request $request, Response $response): void | ||
{ | ||
|
||
} | ||
|
||
public function getApplicationLayerProtocols(): array | ||
{ | ||
return ["h3"]; // that's a property of the server itself...? "h3" is the default mandated by RFC 9114, but section 3.1 allows for custom mechanisms too, technically. | ||
} | ||
|
||
public function handleConnection(Client $client, QuicConnection|Socket $connection): void | ||
{ | ||
|
||
} | ||
|
||
public function getPendingRequestCount(): int | ||
{ | ||
return 0; | ||
} | ||
|
||
public function stop(): void | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace Amp\Http\Server\Driver\Internal; | ||
|
||
class QPack | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace Amp\Http\Server\Driver\Internal; | ||
|
||
use Amp\Http\Server\Driver\Client; | ||
use Amp\Quic\QuicConnection; | ||
use Amp\Socket\Socket; | ||
|
||
abstract class StreamHttpDriver extends ConnectionHttpDriver | ||
{ | ||
public function handleConnection(Client $client, QuicConnection|Socket $connection): void | ||
{ | ||
$this->handleClient($client, $connection, $connection); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.