Workerman ??: HTTP2 ????? ???? ? ??? ???? ??
HTTP2? HTTP ????? ??? ???? ??? ??? ?? ???????. Workerman? ????? ???? PHP ??? ?? ?????? ???, ?? ?? ? ?? ?????? ??? ??? ????. HTTP2 ????? ???? ? ??? ???? ??? ?????? ? ????? ??? ?? ??? ?????.
- HTTP2 ????? ?? ??
- Workerman? HTTP2 ????? ???? ??
- ?? HTTP2 ????? ???? ? ??
- ?? ??
1. HTTP2 ????? ?? ?? HTTP2 ????
HTTP2 ????? HTTP ????? ??? ???? ??? ??? ?? ???????. HTTP1.x ????? ???? ??? ?? ??? ????.
- ???? ????: HTTP2? ???? ????? ???? ?? HTTP1.x? ??? ????? ?????. ???? ????? ???? ? ??? ?? ???? ?????.
- ???: HTTP2? ??? ???? ?? ??? ??? ??? ??? ? ????. ?? ?? ?? ?? ? ?? ??? ???? ? ???? ???? ???? ?????.
- ?? ??: HTTP2? HPACK ????? ???? ?? ? ??? ??? ???? ??? ?? ??? ??? ??? ??????.
- ?? ??: HTTP2? ? ??? ?? ??? ??? ?????? ????? ???? ????? ?? ?? ??? ? ??? ?? ??? ???? ? ????.
2. Workerman? ??? HTTP2 ????? ??????
Workerman? ????? ???? PHP ??? ?? ?????? ??? TCP ???? ???? ??? ??? ????? ?????? HTTP ????? ?????. . Workerman? ????? HTTP1.x ????? ????? HTTP2 ????? ?????.
HTTP2 ????? ??? ????? ??? ???? ??? HTTP2 ????? ???? ?? ?? ??? SSL ???? ??? ???. ??? HTTP2 ????? ????? Workerman?? SSL ???? ???? ???. ???? ?? ??? ??? ????.
$context = array( // 這是key, 一般和crt放在一起 'ssl' => array( // 請(qǐng)使用絕對(duì)路徑 'local_cert' => '/your/path/to/server.crt', // 服務(wù)端證書 'local_pk' => '/your/path/to/server.key', // 服務(wù)端證書的私鑰 'verify_peer' => false, // 是否需要驗(yàn)證客戶端證書 ) ); // 初始化一個(gè)Worker監(jiān)聽http://0.0.0.0:443 $worker = new Worker("http://0.0.0.0:443", $context); // 開啟對(duì)HTTP2.0的支持 $worker->transport = 'ssl'; $worker->protocol = "Http2";
3. ?? HTTP2 ???? ? ?? ??
Workerman? HTTP2 ????? ???? HTTP2 ???? ? ??? ??? ? ????. ???? ?? ???? ?? ??? ????. ???? ?? HTTP2 ???? ? ?? ??? ?? ?? ?????.
- http2_server.php?? PHP ??? ??? ?? ??? ?????.
<?php require_once __DIR__ . '/../vendor/autoload.php'; $context = array( 'ssl' => array( 'local_cert' => '/your/path/to/server.crt', 'local_pk' => '/your/path/to/server.key', 'verify_peer' => false, ) ); $worker = new WorkermanWorker('http://0.0.0.0:443', $context); $worker->transport = 'ssl'; $worker->protocol = "Http2"; $worker->onConnect = function($connection) { echo "new connection from ip " . $connection->getRemoteIp() . " "; }; $worker->onMessage = function($connection, $data) { $request_uri = $_SERVER['REQUEST_URI']; $response = "Hello, HTTP2! "; $connection->send($response); }; Worker::runAll();
- ? ?? ??
?? ??? ???? ? ??? ?????.
php http2_server.php start -d
??, https: //localhost? ????? ????? ???? Hello, HTTP2! ???? ??? ???? ? ? ????.
4. ?? ?
??? ? ?? ??? ??????, ?? ??? ???? ?? ?????. /your/path/to/server.crt ? /your/path/to/server.key? ?? SSL ??? ??? ??? ???.
<?php require_once __DIR__ . '/../vendor/autoload.php'; $context = array( 'ssl' => array( 'local_cert' => '/your/path/to/server.crt', 'local_pk' => '/your/path/to/server.key', 'verify_peer' => false, ) ); $worker = new WorkermanWorker('http://0.0.0.0:443', $context); $worker->transport = 'ssl'; $worker->protocol = "Http2"; $worker->onConnect = function($connection) { echo "new connection from ip " . $connection->getRemoteIp() . " "; }; $worker->onMessage = function($connection, $data) { $request_uri = $_SERVER['REQUEST_URI']; $response = "Hello, HTTP2! "; $connection->send($response); }; Worker::runAll();
??
HTTP2 ????? HTTP ????? ??? ????, HTTP1.x ????? ?? ??? ?? ???? ?? ???????. Workerman? HTTP2 ????? ???? ????? ???? PHP ??? ?? ????????. ? ????? Workerman? ???? SSL ??? ?? ? ?? ? ?? ??? ???? HTTP2 ???? ?? ? ??? ???? ??? ?????.
? ??? Workerman ??: HTTP2 ????? ???? ? ??? ???? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

HTTP 301 ?? ??? ?? ??: ? ??? ????? ???? ?? ???? ???? ??? ???? ?? ???? ? ??? ?? ??? ?? ?? ??? ?? ? ???? ????. ? ??? ???? ? ??? ????? HTTP 301 ?? ??? ?? ???? ????? ??? ?????. ? ????? HTTP 301 ?? ??? ??? ? ??? ????? ???? ?? ???? ????? ?????. HTTP301 ?? ??? ?? ????(PermanentRedirect)? ?????. ??? ?????? ??? ?? ?

Swoole? Workerman? ?? ??? PHP ?? ????????. ??? ??, ??? ?? ? ????? ? ??? Swoole? ?? ?? ?? ??? ?? ???? ???? ?? ????? ?????. Workerman? ?? ???? ?? ??? ??? ???? ????? ? ??? ???? API? ?? ???? ? ??? ??? ???? ?????.

HTTP ?? ?? 200: ???? ??? ??? ?? ?? HTTP ?? ??? ?? ?? ??? ???? ? ???? ?? ?????. ? ? ?? ?? 200? ??? ??? ?? ????? ?????? ?????. ? ????? HTTP ?? ?? 200? ???? ??? ???? ???????. ?? HTTP ?? ??? ??? ??? ?????. ?? ??? 1xx, 2xx, 3xx, 4xx ? 5xx? ?? ?? ??? ????. ? ? 2xx? ???? ??? ?????. ??? 200? 2xx?? ?? ???? ?? ?????.

HTTP ?? ?? 404? ??? ?? ??? ?????. ??: ?? ???? ???? HTTP ?? ?? 404? ?? ??? ???. ? ?? ??? ??? ??? ???? ?? ? ??? ?????. ? ???? HTTP ?? ?? 404? ??? ???? ? ?? ?? ??? ???????. 1. HTTP ?? ?? 404? ??: 1.1 ???? ???? ????. ?? ???? ??? ??? ???? ??? ???? ?? ?????. ?? ??? ??? ?????, ??? ?????, ??? ?? ???? ??? ?? ??? ? ????.

?? ??: 1. ?? ???? Content-Type? ?????. 2. ?? ???? ??? ??? ?????. 3. ??? ??? ??? ?????. 4. ??? ?? ??? ?????. 5. ??? ??? ?????.

C++?? HTTP ????? ???? ??? ?????? Boost.Asio ? asiohttps ????? ?????? ???? SSL ??? ??? ?????. ??? ???? HTTP ??? ????. HTTP ?? ??? ???? ?????. HTTP ?? ??? ???? ?????.

HTTP ?? ??? ???? ??? ?? 504GatewayTimeout ?? ??? ?????. ? ?? ??? ??? ??? ??? ? ??? ??? ???? ?? ???? ?? ??? ?? ??? ?? ??? ???? ??? ?????. 5xx ???? ?? ???, ??? ???? ??? ???? ???? ?????? ??? ???? ??? ? ??? ?????. HTTP ?????? ??? ?? ??? ??? ??? ??? ???, 504 ?? ??? ?? ?? ?? ??? ???? ? ?????. ??

Golang?? HTTP ?? ??? ??? ????? ?? ??? ???? ???. ?? ??? ?????. ?? ??? ??????. ???? ? ?? ??? ?????. ??? ???? ?????.
