Package org.miaixz.bus.core.net
Enum Class Protocol
- All Implemented Interfaces:
Serializable,Comparable<Protocol>,Constable
协议vs计划 它的名字是:
URL.getProtocol() 返回scheme (http, https, etc.),
而不是协议(http/1.1, spdy/3.1,等等) 请使用这个协议来识别它是如何被分割的 Httpd使用协议这个词来标识HTTP消息是如何构造的- Since:
- Java 17+
- Author:
- Kimi Liu
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription明文HTTP/2,没有"upgrade"往返。此选项要求客户端事先知道服务器支持明文HTTP/2http协议过时的plaintext,默认情况下不使用持久套接字包含持久连接的plaintext 此版本的Httpd实现了RFC 7230,并跟踪对该规范的修订IETF的二进制框架协议,包括头压缩、在同一个套接字上多路复用多个请求和服务器推送 HTTP/1.1语义是在HTTP/2上分层的HTTP/3 是用于交换信息的超文本传输协议的第三个主要版本 HTTP/3 在 QUIC 上运行,QUIC 以 RFC 9000 的形式发布。https协议QUIC(快速UDP互联网连接)是一个新的多路复用和UDP之上的安全传输, 从底层设计和优化的HTTP/2语义。HTTP/1.1语义是在HTTP/2上分层的SOAP 1.1协议SOAP 1.2协议Chromium的二进制框架协议,包括标头压缩、在同一个套接字上多路复用多个请求和服务器推送 HTTP/1.1语义在SPDY/3上分层.Supports some version of SSLSupports SSL version 2Supports SSL version 3TCP协议Supports some version of TLSSupports RFC 2246: TLS version 1.0Supports RFC 4346: TLS version 1.1Supports RFC 5246: TLS version 1.2Supports RFC 5246: TLS version 1.3the wsthe wss -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe IPV4 127.0.0.1static final StringThe localhoststatic final StringThe prefix httpstatic final StringThe prefix httpsstatic final longIpv4最大值数值形式static final StringIpv4地址最大值字符串形式static final StringIpv4地址最小值字符串形式static final StringIpv4未使用地址最大值字符串形式final Stringstatic final StringThe prefix wsstatic final StringThe prefix wss -
Method Summary
Modifier and TypeMethodDescriptionstatic Protocolstatic boolean是否为http协议static boolean是否为https协议static booleanisHttpsOrLocalHost(String url) 是否为https协议或本地主机(域名)static booleanisLocalHost(String url) 是否为本地主机(域名)booleanisTcp()toString()返回用于识别ALPN协议的字符串,如“http/1.1”、“spdy/3.1”或“http/2.0”.static ProtocolReturns the enum constant of this class with the specified name.static Protocol[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
TCP
TCP协议 -
UDP
-
HTTP
http协议 -
HTTP_1_0
过时的plaintext,默认情况下不使用持久套接字 -
HTTP_1_1
包含持久连接的plaintext 此版本的Httpd实现了RFC 7230,并跟踪对该规范的修订 -
HTTP_2
IETF的二进制框架协议,包括头压缩、在同一个套接字上多路复用多个请求和服务器推送 HTTP/1.1语义是在HTTP/2上分层的 -
HTTP_3
HTTP/3 是用于交换信息的超文本传输协议的第三个主要版本 HTTP/3 在 QUIC 上运行,QUIC 以 RFC 9000 的形式发布。 -
SPDY_3
Chromium的二进制框架协议,包括标头压缩、在同一个套接字上多路复用多个请求和服务器推送 HTTP/1.1语义在SPDY/3上分层. -
H2_PRIOR_KNOWLEDGE
明文HTTP/2,没有"upgrade"往返。此选项要求客户端事先知道服务器支持明文HTTP/2 -
QUIC
QUIC(快速UDP互联网连接)是一个新的多路复用和UDP之上的安全传输, 从底层设计和优化的HTTP/2语义。HTTP/1.1语义是在HTTP/2上分层的 -
SOAP_1_1
SOAP 1.1协议 -
SOAP_1_2
SOAP 1.2协议 -
WS
the ws -
WSS
the wss -
HTTPS
https协议 -
SSL
Supports some version of SSL -
SSLv2
Supports SSL version 2 -
SSLv3
Supports SSL version 3 -
TLS
Supports some version of TLS -
TLSv1
Supports RFC 2246: TLS version 1.0 -
TLSv1_1
Supports RFC 4346: TLS version 1.1 -
TLSv1_2
Supports RFC 5246: TLS version 1.2 -
TLSv1_3
Supports RFC 5246: TLS version 1.3 -
DICOM
-
HL7
-
-
Field Details
-
HTTP_PREFIX
The prefix http -
HTTPS_PREFIX
The prefix https -
WS_PREFIX
The prefix ws -
WSS_PREFIX
The prefix wss -
HOST_IPV4
The IPV4 127.0.0.1- See Also:
-
HOST_LOCAL
The localhost- See Also:
-
IPV4_STR_MIN
Ipv4地址最小值字符串形式- See Also:
-
IPV4_STR_MAX
Ipv4地址最大值字符串形式- See Also:
-
IPV4_NUM_MAX
public static final long IPV4_NUM_MAXIpv4最大值数值形式- See Also:
-
IPV4_UNUSED_STR_MAX
Ipv4未使用地址最大值字符串形式- See Also:
-
name
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
get
- Parameters:
protocol- 协议标示- Returns:
- 返回由
protocol标识的协议 - Throws:
IOException- ifprotocolis unknown.
-
isHttp
是否为http协议- Parameters:
url- 待验证的url- Returns:
- true: http协议, false: 非http协议
-
isHttps
是否为https协议- Parameters:
url- 待验证的url- Returns:
- true: https协议, false: 非https协议
-
isLocalHost
是否为本地主机(域名)- Parameters:
url- 待验证的url- Returns:
- true: 本地主机(域名), false: 非本地主机(域名)
-
isHttpsOrLocalHost
是否为https协议或本地主机(域名)- Parameters:
url- 待验证的url- Returns:
- true: https协议或本地主机 false: 非https协议或本机主机
-
isTcp
public boolean isTcp() -
toString
返回用于识别ALPN协议的字符串,如“http/1.1”、“spdy/3.1”或“http/2.0”.
-