From 8271d0b973f06fcabffd0ade545ce4f749034bff Mon Sep 17 00:00:00 2001 From: Fabio Sinibaldi Date: Thu, 25 Mar 2021 11:09:20 +0100 Subject: [PATCH] Proxy support --- .../plugins/thredds/ThreddsInstanceManager.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/gcube/data/transfer/plugins/thredds/ThreddsInstanceManager.java b/src/main/java/org/gcube/data/transfer/plugins/thredds/ThreddsInstanceManager.java index f7c8daa..9f36a47 100644 --- a/src/main/java/org/gcube/data/transfer/plugins/thredds/ThreddsInstanceManager.java +++ b/src/main/java/org/gcube/data/transfer/plugins/thredds/ThreddsInstanceManager.java @@ -71,7 +71,18 @@ public class ThreddsInstanceManager { protected ThreddsInstanceManager(DataTransferContext context) { log.warn("Instance Creation. Should happen only once. Loading information from context.."); this.ctx=context; - currentHostname=ctx.getCtx().container().configuration().hostname(); + try { + log.info("Loading proxy configuration.."); + currentHostname=ctx.getCtx().configuration().proxyAddress().hostname(); + if(currentHostname==null||currentHostname.isEmpty()) throw new Exception("Proxy is : "+currentHostname); + }catch(Exception e) { + log.info("Unable to get proxy..",e); + currentHostname=ctx.getCtx().container().configuration().hostname(); + } + log.info("Hostname to be used is "+currentHostname); + + + currentGHNId=ctx.getCtx().container().id(); String tomcatSecurityPath=System.getenv("WEB_CONTAINER_HOME")+"/conf/tomcat-users.xml";