Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Karim

WinSCP.Net lib ignoring proxy informations

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") :
. 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
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);