Skip to content

Add method to set transparent mode in LittleProxy bootstrap #875

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,11 @@ public class BrowserMobProxyServer implements BrowserMobProxy {
* Base64-encoded credentials to use to authenticate with the upstream proxy.
*/
private volatile String chainedProxyCredentials;

/**
* Determines whether to start LittleProxy in transparent mode.
*/
private volatile boolean transparent = false;

public BrowserMobProxyServer() {
}
Expand Down Expand Up @@ -299,6 +304,7 @@ public int getMaximumResponseBufferSizeInBytes() {
return getMaximumResponseBufferSize();
}
})
.withTransparent(transparent)
.withServerResolver(delegatingResolver)
.withAddress(clientBindSocket)
.withConnectTimeout(connectTimeoutMs)
Expand Down Expand Up @@ -1029,6 +1035,10 @@ public boolean isMitmDisabled() {
public void setUseEcc(boolean useEcc) {
this.useEcc = useEcc;
}

public void setTransparent(boolean transparent) {
this.transparent = transparent;
}

/**
* Adds the basic browsermob-proxy filters, except for the relatively-expensive HAR capture filter.
Expand Down