C# Class TrotiNet.BaseProxyLogic

Implement the full HTTP proxy logic for one browser connection
Inheritance: AbstractProxyLogic
Afficher le fichier Open project: Gizeta/Nekoxy-fiddler

Protected Properties

Свойство Type Description
RequestHeaders HttpHeaders
RequestLine HttpRequestLine
ResponseHeaders HttpHeaders
ResponseStatusLine HttpStatusLine
State RequestProcessingState

Méthodes publiques

Méthode Description
BaseProxyLogic ( HttpSocket socketBP ) : System

Base proxy constructor (an arbitrary intermediate step between AbstractProxyLogic, and ProxyLogic)

LogicLoop ( ) : bool

Implement a base proxy logic. The procedure is called for each request as long as it returns true.

Méthodes protégées

Méthode Description
AbortRequest ( ) : void

Pipeline step: close the connections and stop

HandleConnect ( ) : void

A specific case for the CONNECT command, connect both ends blindly (will work for HTTPS, SSH and others)

OnReceiveRequest ( ) : void

Called when RequestLine and RequestHeaders are set

May be used to override State.NextStep

OnReceiveResponse ( ) : void

Called when ResponseStatusLine and ResponseHeaders are set

May be used to override State.NextStep

ReadRequest ( ) : void

Pipeline step: read the HTTP request from the client, schedule the next step to be SendRequest, and call OnReceiveRequest

ReadResponse ( ) : void

Pipeline step: read the HTTP response from the local client, schedule the next step to be SendResponse, and call OnReceiveResponse

SendRequest ( ) : void

Pipeline step: tunnel the request from the client to the remove server, and schedule the next step to be ReadResponse

SendResponse ( ) : void

Pipeline: tunnel the HTTP response from the remote server to the local client, and end the request processing

SendResponseStatusAndHeaders ( ) : void

Send the response status line and headers from the proxy to the client

Private Methods

Méthode Description
HandleWebSocket ( ) : void

Handle a websocket handshake and tunnel the two ends

Method Details

AbortRequest() protected méthode

Pipeline step: close the connections and stop
protected AbortRequest ( ) : void
Résultat void

BaseProxyLogic() public méthode

Base proxy constructor (an arbitrary intermediate step between AbstractProxyLogic, and ProxyLogic)
public BaseProxyLogic ( HttpSocket socketBP ) : System
socketBP HttpSocket
Résultat System

HandleConnect() protected méthode

A specific case for the CONNECT command, connect both ends blindly (will work for HTTPS, SSH and others)
protected HandleConnect ( ) : void
Résultat void

LogicLoop() public méthode

Implement a base proxy logic. The procedure is called for each request as long as it returns true.
public LogicLoop ( ) : bool
Résultat bool

OnReceiveRequest() protected méthode

Called when RequestLine and RequestHeaders are set
May be used to override State.NextStep
protected OnReceiveRequest ( ) : void
Résultat void

OnReceiveResponse() protected méthode

Called when ResponseStatusLine and ResponseHeaders are set
May be used to override State.NextStep
protected OnReceiveResponse ( ) : void
Résultat void

ReadRequest() protected méthode

Pipeline step: read the HTTP request from the client, schedule the next step to be SendRequest, and call OnReceiveRequest
protected ReadRequest ( ) : void
Résultat void

ReadResponse() protected méthode

Pipeline step: read the HTTP response from the local client, schedule the next step to be SendResponse, and call OnReceiveResponse
protected ReadResponse ( ) : void
Résultat void

SendRequest() protected méthode

Pipeline step: tunnel the request from the client to the remove server, and schedule the next step to be ReadResponse
protected SendRequest ( ) : void
Résultat void

SendResponse() protected méthode

Pipeline: tunnel the HTTP response from the remote server to the local client, and end the request processing
protected SendResponse ( ) : void
Résultat void

SendResponseStatusAndHeaders() protected méthode

Send the response status line and headers from the proxy to the client
protected SendResponseStatusAndHeaders ( ) : void
Résultat void

Property Details

RequestHeaders protected_oe property

The request headers of the HTTP request currently being handled
protected HttpHeaders RequestHeaders
Résultat HttpHeaders

RequestLine protected_oe property

The request line of the HTTP request currently being handled
protected HttpRequestLine,TrotiNet RequestLine
Résultat HttpRequestLine

ResponseHeaders protected_oe property

The response header line of the HTTP response received
protected HttpHeaders ResponseHeaders
Résultat HttpHeaders

ResponseStatusLine protected_oe property

The response status line of the HTTP response received
protected HttpStatusLine,TrotiNet ResponseStatusLine
Résultat HttpStatusLine

State protected_oe property

Request processing pipeline state
protected RequestProcessingState State
Résultat RequestProcessingState