Topic "Bypassing proxy"

Author Message
csurfleet

Guest


I'm trying to synch a folder using the winscp automation stuff but I need to bypass the network proxy. Here is my current code:
Code:

Process winscp = new Process();
winscp.StartInfo.FileName = winScpLocation;
winscp.StartInfo.RedirectStandardInput = true;
winscp.StartInfo.UseShellExecute = false;
winscp.StartInfo.CreateNoWindow = true;
winscp.Start();

winscp.StandardInput.WriteLine("option batch abort");
winscp.StandardInput.WriteLine("option confirm off");
winscp.StandardInput.WriteLine("open ftp://" + ftpUserName + ":" + ftpPassword + "@" + ftpSite + " -passive=off");
winscp.StandardInput.WriteLine("put " + appOfflinePath);
winscp.StandardInput.WriteLine("exit");

winscp.StandardInput.Close();

winscp.WaitForExit();


This works fine when transferring to an internal FTP server but not when going external to the network. In FileZilla I would just select the 'bypass proxy' checkbox and all is well but the code above just hangs indefinately.

Any help would be amazing!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Afaik, Bypass proxy in Filezilla just disables using globally set proxy for that particular session. WinSCP does not have global proxy settings. It has per-session proxy settings only. So you just do not set proxy instead. So you code should work as is.

Anyway, I recommend you use WinSCP .NET assembly instead.
http://winscp.net/eng/docs/library
csurfleet

Guest


Hmm weird. I'll have a go with the .net assembly instead, it seems there is definitely some connection setting issue though as it works fine to internal FTP but not externally Confused
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License