This repository was archived by the owner on Feb 21, 2023. It is now read-only.
forked from dparmar/LittleProxy
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathChainedProxy.java
More file actions
89 lines (77 loc) · 2.35 KB
/
ChainedProxy.java
File metadata and controls
89 lines (77 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package org.littleshoot.proxy;
import io.netty.handler.codec.http.HttpObject;
import java.net.InetSocketAddress;
import org.littleshoot.proxy.ntlm.NtlmHandler;
/**
* <p>
* Encapsulates information needed to connect to a chained proxy.
* </p>
*
* <p>
* Sub-classes may wish to extend {@link ChainedProxyAdapter} for sensible
* defaults.
* </p>
*/
public interface ChainedProxy extends SslEngineSource {
/**
* Return the {@link InetSocketAddress} for connecting to the chained proxy.
* Returning null indicates that we won't chain.
*
* @return The Chain Proxy with Host and Port.
*/
InetSocketAddress getChainedProxyAddress();
/**
* (Optional) ensure that the connection is opened from a specific local
* address (useful when doing NAT traversal).
*
* @return
*/
InetSocketAddress getLocalAddress();
/**
* Tell LittleProxy what kind of TransportProtocol to use to communicate
* with the chained proxy.
*
* @return
*/
TransportProtocol getTransportProtocol();
/**
* Implement this method to tell LittleProxy whether or not to encrypt
* connections to the chained proxy for the given request. If true,
* LittleProxy will call {@link SslEngineSource#newSslEngine()} to obtain an
* SSLContext used by the downstream proxy.
*
* @return true of the connection to the chained proxy should be encrypted
*/
boolean requiresEncryption();
/**
* Tell LittleProxy whether or not to do NTLM authentication to the chained
* proxy. Same instance should be returned to maintain state during NLTM
* handshake.
*
* null indicates that we won't do NTLM handshake.
*
* @return NtlmHandler
*/
NtlmHandler getNtlmHandler();
/**
* Filters requests on their way to the chained proxy.
*
* @param httpObject
*/
void filterRequest(HttpObject httpObject);
/**
* Called to let us know that connecting to this proxy succeeded.
*/
void connectionSucceeded();
/**
* Called to let us know that connecting to this proxy failed.
*
* @param cause
* exception that caused this failure (may be null)
*/
void connectionFailed(Throwable cause);
/**
* Called to let us know that we were disconnected.
*/
void disconnected();
}