2

i am using SharpSSH library to upload files to a SFTP server. I can do it fine through my home PC, but from my work's PC, I can not access the server. After contacting the sysadmins (located in another country), they told me I need to access the SFTP server via a proxy since all the company's internet access goes through that proxy.

I have searched a lot and while some posts indicated that this is possible I didn't understand how to do it in .NET (VB.NET specifically). Here's how the code that works perfect from home (or from a a gateway that bypasses the proxy...not possible for production) looks like

Dim objBo As New Tamir.SharpSsh.Sftp("STFP_SERVER_IP", "username", "password")
objBo.Connect()
objBo.Put(strFilename, "/outbox/master_" + Today.Date.ToString("ddMMyyyyHH") + Today.Now.Millisecond.ToString + ".TXT")
objBo.Put(strFilename2, "/outbox/detail_" + Today.Date.ToString("ddMMyyyyHH") + Today.Now.Millisecond.ToString + ".TXT")
objBo.Close()

How do I connect through a proxy?

4
  • I've done some work with the SharpSSH library, and I'll admit it's quite dated (it was a bad port from Java). You might want to check out sshnet.codeplex.com which seems to be maintained and will probably have a way to handle this. Commented Jan 19, 2012 at 16:36
  • I patched in some support for proxies in my fork at bitbucket.org/mattgwagner/sharpssh that might be useful in this case. Commented Mar 12, 2012 at 19:52
  • Hi MattGWagner! Yuor fork is probably the best I had no problems until I am able to use proxy, is there an example with proxy from u? Commented Feb 22, 2014 at 22:01
  • I have same problem.. Commented Apr 30, 2014 at 13:57

2 Answers 2

0

I never used SharpSSH - but I had several projects that use FTP, some of them handling >1000 ftp requests by day.

At first I tried to use the .Net WebRequestMethods.Ftp - but after some testing, I choose to buy Chilkat Software bundle.

It works very well even with HTML proxies - and their support is 5 stars - they have several samples on their website.

It is one of my favorite tools. Note that I am not related any way to Chilkat - just a user who really like their commitment to their products.

0

It's been a long time since i asked this, but if i remember correct i solved this via doing a port forward on the server where the service was deployed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.