Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 27 Mar 2013 12:31:03 -0500 Date: Wed, 27 Mar 2013 17:30:59 +0000 From: lipska the kat <"nospam at neversurrender dot co dot uk"> Organization: Trollbusters 3 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120410 Thunderbird/11.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: POST to secure server References: <87e45e09-ad58-4bf1-87d4-d5b6c1916645@googlegroups.com> In-Reply-To: <87e45e09-ad58-4bf1-87d4-d5b6c1916645@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 38 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-z6wVlfqWU07WoCTbHF+K7iyMvdAppYxJyBsBS+XyFsdH+HvIRMSH4OxgOjCd4CY0TckRVHw7I+XtmBU!boWnFPCqMnQ74VhuWKdS198+lvsPvGSfoNFE+/4w3IWuSWd4W8hr9IICKMWD39qzK3+/q37NrKE= X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2654 Xref: csiph.com comp.lang.java.programmer:23142 On 27/03/13 15:39, RVic wrote: > Silvio, Thank you -- but I am a little confused by what you say. Right now, using JSCH I can connect with: > > JSch jsch = new JSch(); > Session session = jsch.getSession("me"/*user*/, "moonprod"/*serverURL*/); > session.setPort(22); > session.setPassword(password); > session.connect(); > > And the servlet I must reach is on Tomcat on the server on port 28080 which would be hit as http://moonprod:28080/servlets/myservlet > What are you saying, below, that I should change? Thank you! It is a bit confusing isn't it. I think what he is talking about is port forwarding I just downloaded the code for jsch and found an example when you have your session you can set up port forwarding by calling session.setPortForwardingL(lport, rhost, rport); so your example would be session.setPortForwardingL(8888, moonprod.com, 28080); Now, if this works you should be able to make a request on your local machine to localhost:8888 and the request would get forwarded to moonprod.com:28080. At least I think this is what he means, it would be nice to get some clarification. there is some API documentation here http://epaul.github.com/jsch-documentation/javadoc/ lipska -- Lipska the KatŠ: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun