-
Notifications
You must be signed in to change notification settings - Fork 780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility to respond to https requests without connecting upstream servers #230
Possibility to respond to https requests without connecting upstream servers #230
Conversation
This enables a caching proxy for offline use, which is no problem with HTTP at the moment. Additionally HTTPS needs the hostname to create a certificate and must suppress the handshake to upstream without a connection.
UnencryptedUDTChainedProxyTest fails in Travis-CI with Java 8, but works with Java 7 and 6. It works in my environment with Java 8, too: |
I have some reservations about this change. It's very specific to one particular use case, a caching proxy for offline use. I do see the utility of wanting to avoid making connections to the remote server. For non-SSL connections this is already possible using the filters, but for SSL connections it isn't, because the ConnectionFlow always attempts to establish the remote connection. In the long term, I'd like to see a more flexible way of controlling connections, so that users of LittleProxy can customize the connection flow as needed. For now, I'm not sure that checking |
bb5cc92
to
48e8088
Compare
Conflicts: src/main/java/org/littleshoot/proxy/impl/ProxyToServerConnection.java Integrated with MITM while offline, removed unused variable MINIMUM_RECV_BUFFER_SIZE_BYTES Conflicts: src/main/java/org/littleshoot/proxy/impl/ProxyToServerConnection.java
littleproxy master.
MITM and chained proxy are enabled.
Conflicts: src/main/java/org/littleshoot/proxy/impl/ProxyToServerConnection.java
Conflicts: src/main/java/org/littleshoot/proxy/impl/DefaultHttpProxyServer.java src/main/java/org/littleshoot/proxy/impl/ProxyToServerConnection.java src/test/java/org/littleshoot/proxy/MitmWithBadClientAuthenticationTCPChainedProxyTest.java src/test/java/org/littleshoot/proxy/MitmWithBadServerAuthenticationTCPChainedProxyTest.java src/test/java/org/littleshoot/proxy/MitmWithChainedProxyTest.java src/test/java/org/littleshoot/proxy/MitmWithClientAuthenticationNotRequiredTCPChainedProxyTest.java src/test/java/org/littleshoot/proxy/MitmWithEncryptedTCPChainedProxyTest.java src/test/java/org/littleshoot/proxy/MitmWithEncryptedUDTChainedProxyTest.java src/test/java/org/littleshoot/proxy/MitmWithUnencryptedTCPChainedProxyTest.java src/test/java/org/littleshoot/proxy/MitmWithUnencryptedUDTChainedProxyTest.java
Returning null is valid for this method. Decrease log level to info.
enable_offline_caching_with_mitm Conflicts: src/main/java/org/littleshoot/proxy/impl/ProxyToServerConnection.java
For what it's worth, the Betamax testing library also has this requirement, as it works on the basis of replaying recorded responses in place of contacting the target server. I may try the options mentioned in #184 to see if they have an effect. I think this is going to become more and more important as websites default to SSL. |
@pledbrook You need special branches of LittleProxy and LittleProxy-mitm to enable MITM while offline. At the moment consider to use https://github.com/ganskef/LittleProxy-parent to build both. I'm closing this PR since it's replaced with #282. |
This enables a caching proxy for offline use, which is no problem with HTTP at the moment.
Additionally HTTPS needs the hostname to create a certificate and must suppress the handshake to upstream without a connection.
@jekh Please, let us discuss this.