Class Http1Helper
java.lang.Object
cool.scx.http.x.http1.Http1Helper
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte[]static final byte[]static final byte[]static final byte[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckRequestHasBody(cool.scx.http.method.ScxHttpMethod method) static booleancheckResponseHasBody(cool.scx.http.status.ScxHttpStatus status) static ScxUpgradecheckUpgradeRequest(Http1RequestLine requestLine, Http1Headers headers) 检查是不是 升级请求 如果不是 返回 nullstatic voidconsumeInputStream(InputStream inputStream) static cool.scx.http.peer_info.PeerInfoWritablegetLocalPeer(cool.scx.tcp.ScxTCPSocket tcpSocket) static cool.scx.http.peer_info.PeerInfoWritablegetRemotePeer(cool.scx.tcp.ScxTCPSocket tcpSocket) static cool.scx.http.uri.ScxURIinferURI(cool.scx.http.uri.ScxURI requestLineTarget, cool.scx.http.headers.ScxHttpHeaders headers, cool.scx.tcp.ScxTCPSocket tcpSocket) 事实上我们无法拿到真正的地址 所以这里只是推测而已static voidstatic voidvalidateHost(cool.scx.http.headers.ScxHttpHeadersWritable headers) 验证 Http/1.1 中的 Host, 这里我们只校验是否存在且只有一个值
-
Field Details
-
CONTINUE_100
public static final byte[] CONTINUE_100 -
CRLF_BYTES
public static final byte[] CRLF_BYTES -
CRLF_CRLF_BYTES
public static final byte[] CRLF_CRLF_BYTES -
CHUNKED_END_BYTES
public static final byte[] CHUNKED_END_BYTES
-
-
Constructor Details
-
Http1Helper
public Http1Helper()
-
-
Method Details
-
checkUpgradeRequest
检查是不是 升级请求 如果不是 返回 null -
sendContinue100
- Throws:
IOException
-
consumeInputStream
-
getRemotePeer
public static cool.scx.http.peer_info.PeerInfoWritable getRemotePeer(cool.scx.tcp.ScxTCPSocket tcpSocket) -
getLocalPeer
public static cool.scx.http.peer_info.PeerInfoWritable getLocalPeer(cool.scx.tcp.ScxTCPSocket tcpSocket) -
validateHost
public static void validateHost(cool.scx.http.headers.ScxHttpHeadersWritable headers) 验证 Http/1.1 中的 Host, 这里我们只校验是否存在且只有一个值 -
checkResponseHasBody
public static boolean checkResponseHasBody(cool.scx.http.status.ScxHttpStatus status) -
checkRequestHasBody
public static boolean checkRequestHasBody(cool.scx.http.method.ScxHttpMethod method) -
inferURI
public static cool.scx.http.uri.ScxURI inferURI(cool.scx.http.uri.ScxURI requestLineTarget, cool.scx.http.headers.ScxHttpHeaders headers, cool.scx.tcp.ScxTCPSocket tcpSocket) 事实上我们无法拿到真正的地址 所以这里只是推测而已
-