1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is mozilla.org code.
16 *
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 * Bradley Baetz <bbaetz@netscape.com> (Original Developer)
24 * Malcolm Smith <malsmith@cs.rmit.edu.au>
25 *
26 * Alternatively, the contents of this file may be used under the terms of
27 * either the GNU General Public License Version 2 or later (the "GPL"), or
28 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
37 *
38 * ***** END LICENSE BLOCK ***** */
39
40 #include "nsISupports.idl"
41
42 /**
43 * This interface identifies a proxy server.
44 *
45 * @status UNDER_REVIEW
46 */
47 [scriptable, uuid(3fe9308b-1608-4fa0-933c-c5ec2c6175fd)]
48 interface nsIProxyInfo : nsISupports
49 {
50 /**
51 * This attribute specifies the hostname of the proxy server.
52 */
53 readonly attribute AUTF8String host;
54
55 /**
56 * This attribute specifies the port number of the proxy server.
57 */
58 readonly attribute long port;
59
60 /**
61 * This attribute specifies the type of the proxy server as an ASCII string.
62 *
63 * Some special values for this attribute include (but are not limited to)
64 * the following:
65 * "http" HTTP proxy (or SSL CONNECT for HTTPS)
66 * "socks" SOCKS v5 proxy
67 * "socks4" SOCKS v4 proxy
68 * "direct" no proxy
69 * "unknown" unknown proxy (see nsIProtocolProxyService::resolve)
70 *
71 * A future version of this interface may define additional types.
72 */
73 readonly attribute ACString type;
74
75 /**
76 * This attribute specifies flags that modify the proxy type. The value of
77 * this attribute is the bit-wise combination of the Proxy Flags defined
78 * below. Any undefined bits are reserved for future use.
79 */
80 readonly attribute unsigned long flags;
81
82 /**
83 * This attribute specifies the failover timeout in seconds for this proxy.
84 * If a nsIProxyInfo is reported as failed via nsIProtocolProxyService::
85 * getFailoverForProxy, then the failed proxy will not be used again for this
86 * many seconds.
87 */
88 readonly attribute unsigned long failoverTimeout;
89
90 /**
91 * This attribute specifies the proxy to failover to when this proxy fails.
92 */
93 attribute nsIProxyInfo failoverProxy;
94
95
96 /****************************************************************************
97 * The following "Proxy Flags" may be bit-wise combined to construct the
98 * flags attribute defined on this interface. All unspecified bits are
99 * reserved for future use.
100 */
101
102 /**
103 * This flag is set if the proxy is to perform name resolution itself. If
104 * this is the case, the hostname is used in some fashion, and we shouldn't
105 * do any form of DNS lookup ourselves.
106 */
107 const unsigned short TRANSPARENT_PROXY_RESOLVES_HOST = 1 << 0;
108 };