-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
Proxy servers #56
Comments
@Quafadas I had the same issue and I couldn't find anything on the library. However, you can set your JVM to go through the proxy. We used something like this: case class Proxy(url: String, port: Int, user: Option[String] = None, pass: Option[String] = None, scheme: String = "http") {
override def toString: String = s"PROXY (URL: $url; PORT: $port; SCHEME: $scheme)"
}
object Proxies extends LoggingSupport {
def autoSetup(config: ConfigurationReader) = {
val proxies = config.PROXIES
if (proxies.nonEmpty) {
logger.info("Setting up proxies.")
} else {
logger.info("No proxies found.")
}
proxies.foreach { proxy =>
logger.debug(proxy.toString)
System.setProperty(s"${proxy.scheme}.proxyHost", proxy.url)
System.setProperty(s"${proxy.scheme}.proxyPort", proxy.port.toString)
proxy.user.foreach(user => System.setProperty(s"${proxy.scheme}.proxyUser", user))
proxy.pass.foreach(pass => System.setProperty(s"${proxy.scheme}.proxyPassword", pass))
}
config.PROXY_BYPASS.foreach(exp => System.setProperty("https.nonProxyHosts", exp))
config.PROXY_BYPASS.foreach(exp => System.setProperty("http.nonProxyHosts", exp))
}
} Notice that this implementation is based on the Oracle documentation that can be found here. https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html |
Okay, thanks for the above. I'll let you know if I get any mileage. But I think our proxy is doing something weird. I can send a request to the service which gives me back a token, but I think the proxy is stripping the Authorization header of the subsequent requests. I can only ever get back unauthorised... but I can test in Postman etc, that the Authorization header I'm sending is correct... and Postman itself works. I'm lost :-( ... but I'm not sure the problems are in this library... I have a hint that it may be to do with getting SSL correctly setup with client certs... but mostly... I'm just lost. |
TO clarify this, I can never get beyond this stage;
|
Hey, look into my closed issue #59 |
@mdrijwan123 thanks for that post! Unfortunately, providing username/password credentials in the URL didn't work for me (seems that the library is using |
Does this library work behind a corporate proxy.
I think the keywords in python are somehow verify="cert/location",proxies="proxy"... couldn't see anything in the docs so assuming it's not currently implemented. Will try and look but it's probably beyond my skills :-(.
Or is this solved by the open pull request? (he asks hopefully)
The text was updated successfully, but these errors were encountered: