Skip to content
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

Adding Proxy Support (Code attached) #239

Open
ValorHeart opened this issue Apr 29, 2020 · 0 comments
Open

Adding Proxy Support (Code attached) #239

ValorHeart opened this issue Apr 29, 2020 · 0 comments
Assignees

Comments

@ValorHeart
Copy link

ValorHeart commented Apr 29, 2020

Hello, Please review the below code and consider adding it to the difido-testng project.
File: RemoteDifidoReporter (Line 97)
if (difidoConfig.getPropertyAsBoolean(RemoteDifidoOptions.USE_PROXY)) {
String proxyHost = difidoConfig.getPropertyAsString(RemoteDifidoOptions.PROXY_HOST);
int proxyPort = difidoConfig.getPropertyAsInt(RemoteDifidoOptions.PROXY_PORT);
String proxyUserName = difidoConfig.getPropertyAsString(RemoteDifidoOptions.PROXY_USERNAME);
String proxyPassword = difidoConfig.getPropertyAsString(RemoteDifidoOptions.PROXY_PASSWORD);
client = new DifidoClient(host, port, proxyHost, proxyPort, proxyUserName, proxyPassword);
}
else {
client = new DifidoClient(host, port);
}

File: DifidoClient (Line 32)
public DifidoClient(String host, int port, String proxyHost, int proxyPort, String proxyUserName, String proxyPassword) {
baseUri = String.format(BASE_URI_TEMPLATE, host, port);
client = new HttpClient();
Credentials credentials = new UsernamePasswordCredentials(proxyUserName, proxyPassword);
AuthScope authScope = new AuthScope(proxyHost, proxyPort);
client.getState().setProxyCredentials(authScope, credentials);
}

File: RemoteDifidoConfig (Line 26)
USE_PROXY("use.proxy", "false"),
PROXY_HOST("proxy.host", ""),
PROXY_PORT("proxy.port", ""),
PROXY_USERNAME("proxy.username", ""),
PROXY_PASSWORD("proxy.password", "");

@itaiag itaiag self-assigned this Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants