kayx23 commented on code in PR #10990: URL: https://github.com/apache/apisix/pull/10990#discussion_r1549143951
########## docs/en/latest/http3.md: ########## @@ -0,0 +1,128 @@ +--- +title: HTTP/3 protocol +--- + +<!-- +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +--> + +[HTTP/3](https://en.wikipedia.org/wiki/HTTP/3) is the third major version of the Hypertext Transfer Protocol (HTTP). Unlike its predecessors which rely on TCP, HTTP/3 is based on [QUIC (Quick UDP Internet Connections) protocol](https://en.wikipedia.org/wiki/QUIC). It brings several benefits that collectively result in reduced latency and improved performance: + + * enabling seamless transition between different network connections, such as switching from Wi-Fi to mobile data. + * eliminating head-of-line blocking, so that a lost packet does not block all streams. + * negotiate TLS versions at the same time as the TLS handshakes, allowing for faster connections. + * providing encryption by default, ensuring that all data transmitted over an HTTP/3 connection is protected and confidential. + * providing zero round-trip time (0-RTT) when communicating with servers that clients already established connections to. + + APISIX currently supports HTTP/3 connections between downstream clients and APISIX. HTTP/3 connections with upstream services is not yet supported. Contributions are welcomed. + + :::caution + + This feature has not been tested at scale and therefore, is not recommended for production use. + + ::: + +## Usage example + +1. To allow for HTTP/3 connections on 9443 port, add the following configurations to the `config.yaml` file: + +```yaml +apisix: + ssl: + listen: + - port: 9443 + enable_http3: true # enable HTTP/3 + ssl_protocols: TLSv1.3 # enable TLSv1.3 +``` + +**note** `enable_http3` requires `TLSv1.3` + +2. Create an SSL object for test.com. + +```shell +curl http://127.0.0.1:9180/apisix/admin/ssls/1 \ +-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' +{ + "cert" : "'"$(cat t/certs/apisix.crt)"'", + "key": "'"$(cat t/certs/apisix.key)"'", + "snis": ["test.com"] +}' +``` + +3. Create route + +```shell +curl http://127.0.0.1:9180/apisix/admin/routes/1 \ +-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d ' +{ + "uri": "/get", + "hosts": ["test.com"], + "methods": ["GET"], + "upstream": { + "type": "roundrobin", + "nodes": { + "httpbin.org": 1 + } + } +}' +``` + +4. Access verification + +Access test.com using HTTP/3: + +- curl version 7.88.0+, requires [http-only](https://github.com/curl/curl/blob/master/docs/cmdline-opts/http3-only.md) option. + +```shell +curl -k -vvv -H "Host: test.com" -H "content-length: 0" --http3-only --resolve "test.com:9443:127.0.0.1" https://test.com:9443/get Review Comment: the verification step isn't working: ![image](https://github.com/apache/apisix/assets/39619599/55308516-1a62-4a54-bb40-3c29b68b4c21) my curl version: ``` curl 8.7.1 (x86_64-apple-darwin) libcurl/8.7.1 OpenSSL/3.2.1 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 c-ares/1.27.0 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.0 nghttp2/1.60.0 nghttp3/1.2.0 Release-Date: 2024-03-27 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org