]>
git.saurik.com Git - apple/security.git/blob - Network/https-proxy-protocol.h
2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
20 // https-proxy - CONNECT style transparent proxy connection to SSL host
22 #ifndef _H_HTTPS_PROXY_PROTOCOL
23 #define _H_HTTPS_PROXY_PROTOCOL
25 #include "https-protocol.h"
33 // The CONNECT protocol is a subclass of the secure (SSL) HTTP protocol.
35 class ConnectHTTPProtocol
: public SecureHTTPProtocol
{
36 class ConnectHTTPTransfer
;
38 ConnectHTTPProtocol(Manager
&mgr
, const HostTarget
&proxy
);
41 ConnectHTTPTransfer
*makeTransfer(const Target
&target
, Operation operation
);
45 // Our persistent connection object
47 class ConnectHTTPConnection
: public SecureHTTPConnection
{
49 ConnectHTTPConnection(Protocol
&proto
, const HostTarget
&tgt
);
50 ~ConnectHTTPConnection();
53 connectConnecting
, // TCP layer connecting pending
54 connectStartup
, // starting conversation
55 connectPrimaryResponse
, // sent CONNECT, waiting for primary response
56 connectReadHeaders
, // reading proxy headers
57 connectReady
// in transparent mode
60 void connectRequest();
63 void transit(Event event
, char *input
, size_t inputLength
);
68 // A generic Transfer object. All HTTP transfers are transactional (headers in, optional data in,
69 // headers out, optional data out), so there's no reason to distinguish subclasses.
71 class ConnectHTTPTransfer
: public SecureHTTPTransfer
{
73 ConnectHTTPTransfer(Protocol
&proto
,
74 const Target
&tgt
, Operation operation
, IPPort defaultPort
);
79 bool useProxyHeaders() const;
84 const HostTarget
&proxyHost() const;
87 const HostTarget host
;
91 } // end namespace Network
92 } // end namespace Security
95 #endif //_H_HTTPS_PROXY_PROTOCOL