public class HttpDemuxFilter extends Object implements DatagramPacketFilter
DatagramPacketFilter
which allows demultiplexing HTTP(S)
out of MuxServerSocketChannel
. Accepts HTTP, SSL v2, and TLS. Rejects
Google TURN SSLTCP.Modifier and Type | Field and Description |
---|---|
private static byte[][] |
REQUEST_METHOD_BYTES
The US-ASCII
byte s of REQUEST_METHOD_STRINGS . |
private static char |
REQUEST_METHOD_MAX_CHAR
The maximum US-ASCII character with which an element of
REQUEST_METHOD_STRINGS starts. |
static int |
REQUEST_METHOD_MAX_LENGTH
The maximum length in
byte s of a US-ASCII representation of an
HTTP request method supported by the class HttpDemuxFilter . |
private static char |
REQUEST_METHOD_MIN_CHAR
The minimum US-ASCII character with which an element of
REQUEST_METHOD_STRINGS starts. |
private static String[] |
REQUEST_METHOD_STRINGS
The HTTP request methods recognized by the class
HttpDemuxFilter . |
static int |
TLS_MIN_LENGTH
The minimum number of bytes required by the class
HttpDemuxFilter
in order to declare that (the data of) a specific DatagramPacket
represents TLS. |
Constructor and Description |
---|
HttpDemuxFilter() |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(DatagramPacket p)
Determines whether a specific
DatagramPacket looks like the
beginning of HTTP(S) client communication. |
private static byte[][] REQUEST_METHOD_BYTES
byte
s of REQUEST_METHOD_STRINGS
. Explicitly
defined for the purposes of performance.private static final char REQUEST_METHOD_MAX_CHAR
REQUEST_METHOD_STRINGS
starts.public static final int REQUEST_METHOD_MAX_LENGTH
byte
s of a US-ASCII representation of an
HTTP request method supported by the class HttpDemuxFilter
.private static final char REQUEST_METHOD_MIN_CHAR
REQUEST_METHOD_STRINGS
starts.private static String[] REQUEST_METHOD_STRINGS
HttpDemuxFilter
.public static final int TLS_MIN_LENGTH
HttpDemuxFilter
in order to declare that (the data of) a specific DatagramPacket
represents TLS.public boolean accept(DatagramPacket p)
DatagramPacket
looks like the
beginning of HTTP(S) client communication. Accepts HTTP, SSL v2, and
TLS. Rejects Google TURN SSLTCP.accept
in interface DatagramPacketFilter
p
- the DatagramPacket
to analyzetrue
if p
looks like the beginning of HTTP(S)
client communication; otherwise, false
Copyright © 2018. All rights reserved.