Frage

How can I read all the full target URL's in IdHTTPProxyServer? The following code only works HTTP urls. For HTTPS it will only return Server:443 instead of a full URL.

procedure TManager.OnHTTPBeforeCommand(AContext: TIdHTTPProxyServerContext);
var
  URL:String;
begin
  URL := AContext.Target;
end;
War es hilfreich?

Lösung

HTTPS proxying utilizes the HTTP CONNECT verb, which does not connect to a URL, only a host:port. The web client CONNECTs to the target server first to establish a base connection, then establishes an SSL session with that server before then sending the actual HTTP request to it. Since the request is encrypted, there is no way for TIdHTTPProxyServer to capture the full HTTPS URL.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top