hi friend
how to connect to sftp server with (http proxy) AND (private key) ????
thanks :X
how to connect to sftp server with (http proxy) AND (private key) ????
thanks :X
var connectionInfo = new PasswordConnectionInfo(txtHost.Text, 22, txtUsername.Text, txtPassword.Text, ProxyTypes.Http, "209.xxx.xxx.xx", 3128,"proxyUser","proxyPass");
sftp = new SftpClient(connectionInfo);
try
{
sftp.Connect();
addItemToListBox("Connect", "Connect to server Success.");
}
now , when sniffing my connection with wireshark , i can see my http request !!!This should be fixed in changeset 40668.
Let me know if this fixes the problem for you.
public static class SftpClientExtension
{
public static async Task UploadFileAsync(this SftpClient client, Stream input, string path, Action<ulong> uploadCallback = null)
{
await Task.Factory.FromAsync(client.BeginUploadFile(input, path, null, null, uploadCallback), client.EndUploadFile);
}
}
Gert,
it seams the behaviour is not reproducable without our embedded device.
We would like to send you such one. Would you please send me your
contact?
Thanks
Ulrich
{
if (connection_flag == false)
connect();
string downloadedFileName = "upload/01fe46c977e2cbf2159b571a2503a686.zip";
using (var stream = new FileStream("E:\\abedi", FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite))
{
//download the file to our local path
sftp.DownloadFile(downloadedFileName, stream);
stream.Close();
}
}
error doanloading is : Access to the path 'E:\abedi' is denied. /// Download into file stream
FileStream fs = new FileStream(Folder + CurrentFile.Name, FileMode.Create);
client.DownloadFile(CurrentFile.Name, fs);
/// Close file stream
fs.Close();
}Ulrich,
Send me your email adres, and I'll respond with my contact information.
Regards,
Gert
Gert,
thanks for your response.
My contact: schmid@ixxat.de
Yours,
Ulrich