/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set sw=2 ts=8 et tw=80 : */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//----------------------------------------------------------------------------- // nsHttpConnectionInfo - holds the properties of a connection //-----------------------------------------------------------------------------
// http:// uris through a proxy will all share the same CI, because they can // all use the same connection. (modulo pb and anonymous flags). They just use // the proxy as the origin host name. // however, https:// uris tunnel through the proxy so they will have different // CIs - the CI reflects both the proxy and the origin. // however, proxy conenctions made with http/2 (or spdy) can tunnel to the // origin and multiplex non tunneled transactions at the same time, so they have // a special wildcard CI that accepts all origins through that proxy.
class nsISVCBRecord;
namespace mozilla { namespace net {
extern LazyLogModule gHttpLog; class HttpConnectionInfoCloneArgs; class nsHttpTransaction;
// this version must use TLS and you may supply separate // connection (aka routing) information than the authenticated // origin information
nsHttpConnectionInfo(const nsACString& originHost, int32_t originPort, const nsACString& npnToken, const nsACString& username,
nsProxyInfo* proxyInfo, const OriginAttributes& originAttributes, const nsACString& routedHost, int32_t routedPort, bool aIsHttp3, bool aWebTransport = false);
// OK to treat these as an infalible allocation
already_AddRefed<nsHttpConnectionInfo> Clone() const; // This main prupose of this function is to clone this connection info, but // replace mRoutedHost with SvcDomainName in the given SVCB record. Note that // if SvcParamKeyPort and SvcParamKeyAlpn are presented in the SVCB record, // mRoutedPort and mNPNToken will be replaced as well.
already_AddRefed<nsHttpConnectionInfo> CloneAndAdoptHTTPSSVCRecord(
nsISVCBRecord* aRecord) const; void CloneAsDirectRoute(nsHttpConnectionInfo** outCI);
[[nodiscard]] nsresult CreateWildCard(nsHttpConnectionInfo** outParam);
// Compare this connection info to another... // Two connections are 'equal' if they end up talking the same // protocol to the same server. This is needed to properly manage // persistent connections to proxies // Note that we don't care about transparent proxies - // it doesn't matter if we're talking via socks or not, since // a request will end up at the same host. bool Equals(const nsHttpConnectionInfo* info) { return mHashKey.Equals(info->HashKey());
}
// IsTrrServiceChannel means that this connection is used to send TRR requests // over void SetIsTrrServiceChannel(bool aIsTRRChannel) {
mIsTrrServiceChannel = aIsTRRChannel;
} bool GetIsTrrServiceChannel() const { return mIsTrrServiceChannel; }
// Returns true for any kind of proxy (http, socks, https, etc..) bool UsingProxy();
// Returns true when proxying over HTTP or HTTPS bool UsingHttpProxy() const { return mUsingHttpProxy || mUsingHttpsProxy; }
// Returns true when only proxying over HTTP bool UsingOnlyHttpProxy() const { return mUsingHttpProxy; }
// Returns true when proxying over HTTPS bool UsingHttpsProxy() const { return mUsingHttpsProxy; }
// Returns true when a resource is in SSL end to end (e.g. https:// uri) bool EndToEndSSL() const { return mEndToEndSSL; }
// Returns true when at least first hop is SSL (e.g. proxy over https or https // uri) bool FirstHopSSL() const { return mEndToEndSSL || mUsingHttpsProxy; }
// Returns true when CONNECT is used to tunnel through the proxy (e.g. // https:// or ws://) bool UsingConnect() const { return mUsingConnect; }
// Returns true when origin/proxy is an RFC1918 literal. bool HostIsLocalIPLiteral() const;
bool mLessThanTls13; // This will be set to true if we negotiate less than // tls1.3. If the tls version is till not know or it // is 1.3 or greater the value will be false. bool mIsHttp3 = false; bool mWebTransport = false;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.