启用http3模块,执行如下命令:

java -jar $JETTY_HOME/start.jar --add-modules=http3

命令的输出,如下:

ALERT: There are enabled module(s) with licenses.
The following 2 module(s):
+ contains software not provided by the Eclipse Foundation!
+ contains software not covered by the Eclipse Public License!
+ has not been audited for compliance with its license Module: jna
+ Java Native Access (JNA) is licensed under the LGPL, version 2.1
+ or later, or (from version 4.0 onward) the Apache License,
+ version 2.0.
+ You can freely decide which license you want to apply to the project.
+ You may obtain a copy of the LGPL License at:
+ http://www.gnu.org/licenses/licenses.html
+ A copy is also included in the downloadable source code package
+ containing JNA, in file "LGPL2.1", under the same directory
+ as this file.
+ You may obtain a copy of the Apache License at:
+ http://www.apache.org/licenses/
+ A copy is also included in the downloadable source code package
+ containing JNA, in file "AL2.0", under the same directory
+ as this file. Module: quiche
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Proceed (y/N)? y
INFO : alpn-java transitively enabled
INFO : alpn transitively enabled, ini template available with --add-modules=alpn
INFO : work transitively enabled
INFO : http2 transitively enabled, ini template available with --add-modules=http2
INFO : http3 initialized in ${jetty.base}/start.d/http3.ini
INFO : jna transitively enabled
INFO : ssl transitively enabled, ini template available with --add-modules=ssl
INFO : quiche transitively enabled
INFO : mkdir ${jetty.base}/work
INFO : mkdir ${jetty.base}/lib/http3
INFO : download https://repo1.maven.org/maven2/net/java/dev/jna/jna-jpms/5.14.0/jna-jpms-5.14.0.jar to ${jetty.base}/lib/http3/jna-jpms-5.14.0.jar
INFO : download https://repo1.maven.org/maven2/org/mortbay/jetty/quiche/jetty-quiche-native/0.20.0/jetty-quiche-native-0.20.0.jar to ${jetty.base}/lib/http3/jetty-quiche-native-0.20.0.jar
INFO : Base directory was modified

http3模块的配置文件$JETTY_BASE/start.d/http3.ini,内容如下:

# ---------------------------------------
# Module: http3
# Enables experimental support for the HTTP/3 protocol.
# ---------------------------------------
--modules=http3 ## The host/address to bind the connector to.
# jetty.quic.host=0.0.0.0 ## The port the connector listens on.
# jetty.quic.port=8444 ## The connector idle timeout, in milliseconds.
# jetty.quic.idleTimeout=30000 ## Specifies the maximum number of concurrent requests per session.
# jetty.quic.maxBidirectionalRemoteStreams=128 ## Specifies the session receive window (client to server) in bytes.
# jetty.quic.sessionRecvWindow=4194304 ## Specifies the stream receive window (client to server) in bytes.
# jetty.quic.bidirectionalStreamRecvWindow=2097152 ## Specifies the stream idle timeout, in milliseconds.
# jetty.http3.streamIdleTimeout=30000

各参数的说明,如下:

  • jetty.quic.host

    监听服务的主机地址,默认值为0.0.0.0,即在本机所有的IP地址上监听链接的请求。
  • jetty.quic.idleTimeout

    链接的空闲时长,单位:毫秒,默认值为30000,即30秒。
  • jetty.quic.maxBidirectionalRemoteStreams

    单个会话中允许并行发起的请求的数量。默认值为128
  • jetty.quic.sessionRecvWindow

    会话的接收数据的窗口,单位:字节。默认值为4194304
  • jetty.quic.bidirectionalStreamRecvWindow

    双向传输时接收数据的窗口,缓冲区的大小,单位:字节。默认值为2097152
  • jetty.http3.streamIdleTimeout

    单位:毫秒,默认值为30000,即30秒。

参考资料

Jetty的http3模块的更多相关文章

  1. Jetty使用教程(四:21-22)—Jetty开发指南

    二十一.嵌入式开发 21.1 Jetty嵌入式开发HelloWorld 本章节将提供一些教程,通过Jetty API快速开发嵌入式代码 21.1.1 下载Jetty的jar包 Jetty目前已经把所有 ...

  2. Jetty源码分析(一)

    一.目的 1.了解jetty组成架构: 2.学习jetty启动过程: 3.学习请求访问过程: 4.学习jetty内各模块作用,学习各模块内部代码: 二.jetty版本 本文所学习的jetty版本为:9 ...

  3. Windows 上的 Jetty 小工具

    做项目经常遇到需要开发Java应用,我喜欢用Jetty进行开发.部署,主要是由于Jetty的轻量级. Jetty 项目主页:http://www.eclipse.org/jetty/, 最新版9.30 ...

  4. Jetty应用服务器的安装详解

    Jetty是一个开源的Servlet容器和应用服务器,它极度轻量级.高便携性.功能强大.灵活和扩展性好,而且支持各种技术如SPDY.WebSocket.OSGi.JMX.JNDI和JAAS.Jetty ...

  5. Jetty开发指导:HTTP Client

    介绍 Jetty HTTP client模块提供易用的API.工具类和一个高性能.异步的实现来运行HTTP和HTTPS请求. Jetty HTTP client模块要求Java版本号1.7或者更高,J ...

  6. 二、Jetty的配置说明

    运行Jetty Web应用 在Jetty应用服务器中部署war项目很简单,只需把项目war包放入Jetty的webapps子目录即可.你都无需重启Jetty,Jetty会自动随时监听webapps目录 ...

  7. Spring Boot 学习(3)

    文 by / 林本托 Tips 做一个终身学习的人. Tips 代码路径:https://github.com/iqcz/Springbootdemo/tree/master/code01/ch3 W ...

  8. Spring HttpInvoker 从实战到源码追溯

    Spring HttpInvoker 作为 Spring 家族中老牌远程调用模型,深受开发者喜爱. 其主要目的是来执行基于 HTTP 的远程调用(轻松穿越防火墙),并使用标准的 JDK 序列化机制. ...

  9. 尚硅谷springboot学习25-嵌入式Servlet容器

    SpringBoot默认使用Tomcat作为嵌入式的Servlet容器:

  10. 四、Spring Boot Web开发

    四.Web开发 1.简介 使用SpringBoot: 1).创建SpringBoot应用,选中我们需要的模块: 2).SpringBoot已经默认将这些场景配置好了,只需要在配置文件中指定少量配置就可 ...

随机推荐

  1. 基于kubeadm部署k8s1.80.0

    k8s搭建 硬件要求 测试环境 # master 2核 4G 20G # node 4核 8G 40G 生产环境 # master 8核 16G 100G # node 16核 64G 500G 方式 ...

  2. 【LeetCode二叉树#07】左叶子节点之和(基于栈的迭代法前中后序遍历复习)

    左叶子节点之和 力扣题目链接(opens new window) 计算给定二叉树的所有左叶子之和. 示例: 思路 注意审题,这里是要求 左叶子节点 之和 不是二叉树中的左侧节点之和,因此使用层序遍历是 ...

  3. mysql常用语句(持续更新)

    查询数据库中各表数量 select table_name,table_rows from information_schema.tables where TABLE_SCHEMA = 'miot' o ...

  4. 【aspose-words】Aspose.Words for Java模板语法详细剖析

    前言 缘由 aspose-words模板语法再了解 垂死病中惊坐起,小丑竟是我自己.对于aspose-words的使用本狗自以为已炉火纯青,遂在新的迭代任务中毛遂自荐,并在小姐姐面前吹了一个大牛,分分 ...

  5. aardio 背景透明的3种方式(透明窗体1 webview2,透明窗体2-win-region-bitmap,透明窗体3-winform-transparent-color)

    aardio 背景透明的3种方式(透明窗体1 webview2,透明窗体2-win-region-bitmap,透明窗体3-winform-transparent-color) 3种透明窗体,主要分成 ...

  6. 重新认识 tag 快照 git (项目临时添加需求,之前有分支合并,导致从节点拉分支不行了,因为没有tag快照)

    之前的tag认知 之前一直以为tag就是在git的提交commit上打一个标,然后可以拉出分支.之前没太重视. 因为我觉得 可以直接从某个commit直接拉出分支,这打不打tag无所谓 翻车现场 今天 ...

  7. 数组动态表单验证,添加数组,逆序添加,表单验证会错位,发现是key的默认index问题,还有验证trigger问题,添加数据会爆红

    数组动态表单验证,添加数组,逆序添加,表单验证会错位,发现是key的默认index问题,还有验证trigger问题,添加数据会爆红 解决方案: trigger: 'blur,change' 换 tri ...

  8. glibc 2.23 源码分析

    1. 基础知识 1.1 Linux 进程内存布局 Linux 系统在装载 elf 格式的程序文件时,会调用 loader 把可执行文件中的各个段依次载入到从某一地址开始的空间中(载入地址取决于 lin ...

  9. c语言中内存分配malloc,calloc,realloc函数的区别和联系

    一 概念: A malloc() 在内存的动态存储区中分配一块长度为size字节的连续区域,参数size为需要内存空间的长度,返回该区域的首地址 B calloc() 与malloc相似,参数size ...

  10. 单麦克风AI降噪模块及解决方案

    前记   随着以AI为核心的智能设备的广泛发展,语音这个非常重要的入口一直是很多厂商争夺的市场.作为音频采集的前端设备,能采集到的距离远,清晰度高,无噪声的信号是一个非常重要的能力.这样就对音频前端降 ...