final class DirectProxyConnection
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.net.Socket |
m_clientSocket |
private static java.text.DateFormat |
m_DateFormat |
private java.io.InputStream |
m_inputStream |
private int |
m_iPort
The port of the URI of the last received request.
|
private static java.text.NumberFormat |
m_NumberFormat |
private DirectProxy |
m_parentProxy
The proxy server this connection is associated to.
|
private java.lang.String |
m_requestLine |
private java.io.InputStream |
m_socketInputStream |
private java.lang.String |
m_strFile
The file portion of the URI of the last received request.
|
private java.lang.String |
m_strHost
The host of the URI of the last received request.
|
private java.lang.String |
m_strMethod
The method of the last received request.
|
private java.lang.String |
m_strProtocol
The protocol part of the URI of the last received request.
|
private java.lang.String |
m_strURI
The destination URI of the last received request.
|
private java.lang.String |
m_strVersion
The protocol version of the last received request if present.
|
private static int |
m_threadCount |
private int |
m_threadNumber |
private static java.lang.Object |
SYNC_SINGLE_CONNECTION |
Constructor and Description |
---|
DirectProxyConnection(java.net.Socket a_clientSocket,
java.io.InputStream a_socketInputStream,
DirectProxy a_parentProxy) |
Modifier and Type | Method and Description |
---|---|
private void |
badRequest() |
private void |
cannotConnect() |
private boolean |
filter(java.lang.String l) |
private int |
getThreadNumber() |
static DirectProxy.RequestInfo |
getURI(java.io.PushbackInputStream a_inputStream,
int a_bufferLength)
Takes a
PushbackInputStream and reads up to a_bufferLength
bytes from it to create a DirectProxy.RequestInfo object describing the
Request and its parts. |
private void |
handleCONNECT() |
private void |
handleFTP() |
private void |
handleHTTP(boolean a_bPost)
Handles the communication with the destination HTTP server and sends the
request
|
private void |
handleRequest(java.io.InputStream a_inputStream)
Reads a request from the given InputStream.
|
static java.lang.String |
readLine(java.io.InputStream inputStream) |
private static java.lang.String |
readLine(java.io.InputStream inputStream,
byte[] r_bytesRead,
int[] len) |
private void |
responseTemplate(java.lang.String error,
java.lang.String message) |
private void |
unknownProtocol() |
private java.net.Socket m_clientSocket
private java.io.InputStream m_socketInputStream
private int m_threadNumber
private static int m_threadCount
private java.io.InputStream m_inputStream
private java.lang.String m_requestLine
private java.lang.String m_strMethod
private java.lang.String m_strURI
private java.lang.String m_strProtocol
private java.lang.String m_strVersion
private java.lang.String m_strHost
private java.lang.String m_strFile
private int m_iPort
private static java.text.DateFormat m_DateFormat
private static java.text.NumberFormat m_NumberFormat
private DirectProxy m_parentProxy
private static final java.lang.Object SYNC_SINGLE_CONNECTION
public DirectProxyConnection(java.net.Socket a_clientSocket, java.io.InputStream a_socketInputStream, DirectProxy a_parentProxy)
private static java.lang.String readLine(java.io.InputStream inputStream, byte[] r_bytesRead, int[] len) throws java.lang.Exception
java.lang.Exception
public static java.lang.String readLine(java.io.InputStream inputStream) throws java.lang.Exception
java.lang.Exception
public static DirectProxy.RequestInfo getURI(java.io.PushbackInputStream a_inputStream, int a_bufferLength)
PushbackInputStream
and reads up to a_bufferLength
bytes from it to create a DirectProxy.RequestInfo
object describing the
Request and its parts.a_inputStream
- Inputstream to read the request in from.a_bufferLength
- Length of the buffer to read the request into.private void handleRequest(java.io.InputStream a_inputStream)
a_inputStream
- #handleCONNECT()}
,
#handleHTTP(boolean)}
,
#handleFTP()}
,
#badRequest()}
private void responseTemplate(java.lang.String error, java.lang.String message)
private void cannotConnect()
private void unknownProtocol()
private void badRequest()
private void handleCONNECT() throws java.lang.Exception
java.lang.Exception
private void handleHTTP(boolean a_bPost) throws java.lang.Exception
a_bPost
- java.lang.Exception
private void handleFTP()
private boolean filter(java.lang.String l)
private int getThreadNumber()
Copyright © 2023. All rights reserved.