Topic "WinSCP.Net lib ignoring proxy informations"

Author Message
Karim
[View user's profile]

Joined: 2015-05-06
Posts: 2
Hi !
Using a HTTP proxy and connecting to a FTP server, WinSCP.Net 5.7.2 seems to ignore proxy settings in RawSettings.
Works fine using the GUI, checking Squid's access_log to be sure, here's the log (notice the "Proxy : None") :
Code:
. 2015-05-06 16:41:57.585 WinSCP Version 5.7.2 (Build 5316) (OS 6.1.7601 Service Pack 1 - Windows 7 Professional)
. 2015-05-06 16:41:57.585 Configuration: Command-line options overriding nul
. 2015-05-06 16:41:57.585 Log level: Normal
. 2015-05-06 16:41:57.585 Local account: EXPLOIT\Feurrisson
. 2015-05-06 16:41:57.585 Working directory: I:\Mehhh\_Tout
. 2015-05-06 16:41:57.585 Process ID: 8572
. 2015-05-06 16:41:57.585 Command-line: "I:\blah\winscp.exe" /xmllog="C:\Users\Flamajou\AppData\Local\Temp\wscp0678.01D21280.tmp" /xmlgroups /nointeractiveinput /dotnet=572  /ini=nul /log="I:\svn-wagner\Sonate\branches\606\Automates\Telegestion\bin\Debug\_Tout\logs\logWinScp_20150506.txt"  /rawconfig ProxyMethod="3" ProxyLocalhost="1" FtpProxyLogonType="2" FSProtocol="5" ProxyHost="172.16.16.59" ProxyPort="3128" /console /consoleinstance=_1656_44365459_739
. 2015-05-06 16:41:57.585 Time zone: Current: GMT+2, Standard: GMT+1 (Paris, Madrid), DST: GMT+2 (Paris, Madrid (heure d’été)), DST Start: 29/03/2015, DST End: 25/10/2015
. 2015-05-06 16:41:57.586 Login time: mercredi 6 mai 2015 16:41:57
. 2015-05-06 16:41:57.586 --------------------------------------------------------------------------
. 2015-05-06 16:41:57.586 Script: Retrospectively logging previous script records:
> 2015-05-06 16:41:57.586 Script: option batch on
< 2015-05-06 16:41:57.586 Script: batch           on       
< 2015-05-06 16:41:57.586 Script: reconnecttime   120       
> 2015-05-06 16:41:57.586 Script: option confirm off
< 2015-05-06 16:41:57.586 Script: confirm         off       
> 2015-05-06 16:41:57.586 Script: option reconnecttime 120
< 2015-05-06 16:41:57.586 Script: reconnecttime   120       
> 2015-05-06 16:41:57.586 Script: open ftp://username:***@host.ovh.net:21 -passive=1 -timeout=15
. 2015-05-06 16:41:57.586 --------------------------------------------------------------------------
. 2015-05-06 16:41:57.586 Session name: username@host.ovh.net (Ad-Hoc site)
. 2015-05-06 16:41:57.586 Host name: host.ovh.net (Port: 21)
. 2015-05-06 16:41:57.586 User name: username (Password: Yes, Key file: No)
. 2015-05-06 16:41:57.586 Transfer Protocol: FTP
. 2015-05-06 16:41:57.586 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec
. 2015-05-06 16:41:57.586 Disable Nagle: No
. 2015-05-06 16:41:57.586 Proxy: none
. 2015-05-06 16:41:57.586 Send buffer: 262144
. 2015-05-06 16:41:57.586 UTF: 2
. 2015-05-06 16:41:57.586 FTP: FTPS: None; Passive: Yes [Force IP: A]; MLSD: A [List all: A]
. 2015-05-06 16:41:57.586 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2015-05-06 16:41:57.586 Cache directory changes: Yes, Permanent: Yes
. 2015-05-06 16:41:57.586 Timezone offset: 0h 0m
. 2015-05-06 16:41:57.586 --------------------------------------------------------------------------


Edit : here is the c# code i use
Code:

session.AddRawConfiguration("ProxyMethod", "3"); // http
session.AddRawConfiguration("ProxyLocalhost", "1");
session.AddRawConfiguration("FtpProxyLogonType", "2");
session.AddRawConfiguration("FSProtocol", "5");
session.AddRawConfiguration("ProxyHost", "host");
session.AddRawConfiguration("ProxyPort", "3128");
session.SessionLogPath = Path.Combine(Utils.Logger.DossierLog, String.Format("logWinScp_{0}.txt", DT.Now.ToAMJ())); // un log par jour
session.DebugLogLevel = 1;                   
session.Open(options);
session.PutFiles(file, remotePath);
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Use SessionOptions.AddRawSettings, not Session.AddRawConfiguration.

See
http://winscp.net/eng/docs/rawsettings
http://winscp.net/eng/docs/library_sessionoptions_addrawsettings
Karim
[View user's profile]

Joined: 2015-05-06
Posts: 2
prikryl wrote:
Use SessionOptions.AddRawSettings, not Session.AddRawConfiguration.

See
http://winscp.net/eng/docs/rawsettings
http://winscp.net/eng/docs/library_sessionoptions_addrawsettings

My bad, works like a charm now.
Thanks a lot.
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