Panos Antoniou
Panos Antoniou

Reputation: 81

How to use SharpSSH SFTP library for .NET with a proxy?

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?

Upvotes: 2

Views: 3646

Answers (2)

Panos Antoniou
Panos Antoniou

Reputation: 81

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.

Upvotes: 0

Carlos C
Carlos C

Reputation: 1

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.

Upvotes: 0

Related Questions