public class HTTPProxyCallback extends java.lang.Object implements ProxyCallback
Modifier and Type | Class and Description |
---|---|
class |
HTTPProxyCallback.DownstreamUnhandledException |
static class |
HTTPProxyCallback.HTTPConnectionHeader |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
HTTP_ACCEPT |
static java.lang.String |
HTTP_ACCEPT_CHARSET |
static java.lang.String |
HTTP_ACCEPT_ENCODING |
static java.lang.String |
HTTP_ACCEPT_LANGUAGE |
static java.lang.String |
HTTP_ATTR_CLOSE |
static java.lang.String |
HTTP_ATTR_KEEP_ALIVE |
static java.lang.String |
HTTP_CACHE_CONTROL |
static java.lang.String |
HTTP_CONNECTION |
static java.lang.String |
HTTP_CONTENT_ENCODING |
static java.lang.String |
HTTP_CONTENT_LENGTH |
static java.lang.String |
HTTP_CONTENT_TYPE |
static java.lang.String |
HTTP_COOKIE |
static java.lang.String |
HTTP_HOST |
static java.lang.String |
HTTP_IE_UA_CPU |
static java.lang.String |
HTTP_KEEP_ALIVE |
static java.lang.String |
HTTP_LOCATION |
static java.lang.String |
HTTP_PRAGMA |
static java.lang.String |
HTTP_PROXY_CONNECTION |
static java.lang.String |
HTTP_RANGE |
static java.lang.String |
HTTP_REFERER |
static java.lang.String |
HTTP_START_LINE_KEY |
static java.lang.String |
HTTP_USER_AGENT |
static java.lang.String |
HTTP_VERSION_PREFIX |
static java.lang.String |
MSG_URL_ANONYMITY_TEST |
static int |
REDIRECT_ANONYMITY_TEST |
static int |
REDIRECT_SQUID_REMINDER |
STATUS_DELAY, STATUS_FINISHED, STATUS_PROCESSABLE
Constructor and Description |
---|
HTTPProxyCallback() |
Modifier and Type | Method and Description |
---|---|
void |
addHTTPConnectionListener(AbstractHTTPConnectionListener listener) |
static boolean |
checkValidity(java.lang.String headerData)
checks whether the HTTP message headers fragment specified by headerData
contains invalid line terminations, i.e. all terminations other
than CRLF
|
void |
closeRequest(AnonProxyRequest anonRequest)
Signals to the
HTTPProxyCallback that the given
AnonProxyRequest is being closed and all the related stored data
can be discarded. |
void |
fireDownstreamContentBytesReceived(HTTPConnectionEvent event) |
void |
fireRequestHeadersReceived(HTTPConnectionEvent event) |
void |
fireResponseHeadersReceived(HTTPConnectionEvent event) |
void |
fireUpstreamContentBytesReceived(HTTPConnectionEvent event) |
long |
getDownStreamContentBytes(AnonProxyRequest anonRequest) |
long |
getUpStreamContentBytes(AnonProxyRequest anonRequest) |
int |
handleDownstreamChunk(AnonProxyRequest anonRequest,
ProxyCallbackBuffer buffer)
Processes a chunk of received data, before it is given to the client of the
proxy.
|
int |
handleUpstreamChunk(AnonProxyRequest anonRequest,
ProxyCallbackBuffer buffer)
Processes a chunk of data, before it is sent out.
|
static int |
indexOfHTTPHeaderEnd(byte[] prefix,
byte[] chunk,
int chunkStartIndex,
int chunkEndIndex)
Returns the index of the first char after the first occurence of the CRLFCRLF termination
in the array 'chunk' or -1 if such a termination sequence was not found.
|
static int |
indexOfHTTPHeaderEnd(byte[] chunk,
int startIndex,
int endIndex)
Returns the index of the first char after the first occurence of the CRLFCRLF termination
in the array 'chunk' or -1 if such a termination sequence was not found.
|
static boolean |
isAnonymityTestDomain(HTTPProxyCallback.HTTPConnectionHeader a_connectionHeader) |
static boolean |
isJonDosDomain(HTTPProxyCallback.HTTPConnectionHeader a_connectionHeader) |
static java.lang.String |
parseDomain(java.lang.String a_URL,
boolean a_bRemoveSubdomain) |
static boolean |
redirect(HTTPProxyCallback.HTTPConnectionHeader a_connectionHeader,
int a_redirectTarget) |
void |
removeAllHTTPConnectionListeners() |
void |
removeHTTPConnectionListener(AbstractHTTPConnectionListener listener) |
public static final java.lang.String MSG_URL_ANONYMITY_TEST
public static final java.lang.String HTTP_START_LINE_KEY
public static final java.lang.String HTTP_VERSION_PREFIX
public static final java.lang.String HTTP_CONTENT_LENGTH
public static final java.lang.String HTTP_CONTENT_ENCODING
public static final java.lang.String HTTP_CONTENT_TYPE
public static final java.lang.String HTTP_HOST
public static final java.lang.String HTTP_USER_AGENT
public static final java.lang.String HTTP_ACCEPT
public static final java.lang.String HTTP_LOCATION
public static final java.lang.String HTTP_ACCEPT_LANGUAGE
public static final java.lang.String HTTP_ACCEPT_ENCODING
public static final java.lang.String HTTP_ACCEPT_CHARSET
public static final java.lang.String HTTP_KEEP_ALIVE
public static final java.lang.String HTTP_ATTR_KEEP_ALIVE
public static final java.lang.String HTTP_ATTR_CLOSE
public static final java.lang.String HTTP_PROXY_CONNECTION
public static final java.lang.String HTTP_CONNECTION
public static final java.lang.String HTTP_REFERER
public static final java.lang.String HTTP_CACHE_CONTROL
public static final java.lang.String HTTP_COOKIE
public static final java.lang.String HTTP_PRAGMA
public static final java.lang.String HTTP_RANGE
public static final java.lang.String HTTP_IE_UA_CPU
public static final int REDIRECT_ANONYMITY_TEST
public static final int REDIRECT_SQUID_REMINDER
public int handleUpstreamChunk(AnonProxyRequest anonRequest, ProxyCallbackBuffer buffer) throws ProxyCallbackNotProcessableException
ProxyCallback
handleUpstreamChunk
in interface ProxyCallback
anonRequest
- The request the data is from.buffer
- Data that is sent to and from the ProxyCallback object.ProxyCallbackNotProcessableException
- if an error occurred during
processing of the data.public int handleDownstreamChunk(AnonProxyRequest anonRequest, ProxyCallbackBuffer buffer) throws ProxyCallbackNotProcessableException
ProxyCallback
handleDownstreamChunk
in interface ProxyCallback
anonRequest
- The request the data is from.buffer
- Data that is sent to and from the ProxyCallback object.ProxyCallbackNotProcessableException
- if an error occurred during
processing of the data.public long getUpStreamContentBytes(AnonProxyRequest anonRequest)
public long getDownStreamContentBytes(AnonProxyRequest anonRequest)
public static boolean isJonDosDomain(HTTPProxyCallback.HTTPConnectionHeader a_connectionHeader)
public static boolean isAnonymityTestDomain(HTTPProxyCallback.HTTPConnectionHeader a_connectionHeader)
public static boolean redirect(HTTPProxyCallback.HTTPConnectionHeader a_connectionHeader, int a_redirectTarget)
public static boolean checkValidity(java.lang.String headerData)
headerData
- the fragment of the HTTP headers of a HTTP messagepublic static int indexOfHTTPHeaderEnd(byte[] chunk, int startIndex, int endIndex)
public static int indexOfHTTPHeaderEnd(byte[] prefix, byte[] chunk, int chunkStartIndex, int chunkEndIndex)
public void addHTTPConnectionListener(AbstractHTTPConnectionListener listener)
public void removeHTTPConnectionListener(AbstractHTTPConnectionListener listener)
public void removeAllHTTPConnectionListeners()
public void fireRequestHeadersReceived(HTTPConnectionEvent event)
public void fireResponseHeadersReceived(HTTPConnectionEvent event)
public void fireDownstreamContentBytesReceived(HTTPConnectionEvent event)
public void fireUpstreamContentBytesReceived(HTTPConnectionEvent event)
public void closeRequest(AnonProxyRequest anonRequest)
HTTPProxyCallback
that the given
AnonProxyRequest
is being closed and all the related stored data
can be discarded.closeRequest
in interface ProxyCallback
public static java.lang.String parseDomain(java.lang.String a_URL, boolean a_bRemoveSubdomain)
Copyright © 2023. All rights reserved.