1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-12-01 22:29:52 +02:00
Files
OpenIntegrations/docs/en/examples/SFTP/CreateConnection.txt

44 lines
1.2 KiB
Plaintext
Raw Normal View History

2025-09-25 22:19:13 +03:00
 Host = "172.33.0.13";
Port = "2222";
UseProxy = True;
ProxySettings = Undefined;
AuthorizationType = "By login and password";
If AuthorizationType = "By login and password" Then
Login = "bayselonarrend";
Password = "12we...";
2025-10-05 19:19:32 +03:00
SFTPSettings = OPI_SFTP.GetSettingsLoginPassword(Host, Port, Login, Password);
2025-09-25 22:19:13 +03:00
ElsIf AuthorizationType = "By key" Then
Login = "bayselonarrend";
PrivateKey = "./ssh_key";
PublicKey = "./ssh_key.pub";
2025-10-05 19:19:32 +03:00
SFTPSettings = OPI_SFTP.GetSettingsPrivateKey(Host, Port, Login, PrivateKey, PublicKey);
2025-09-25 22:19:13 +03:00
Else
2025-10-05 19:19:32 +03:00
Login = "bayselonarrend";
SFTPSettings = OPI_SFTP.GetSettingsViaAgent(Host, Port, Login);
2025-09-25 22:19:13 +03:00
EndIf;
If UseProxy Then
ProxyType = "http"; // http, socks5, socks4
ProxyAddress = "127.0.0.1";
ProxyPort = "8071";
ProxyLogin = "proxyuser";
ProxyPassword = "12we...";
ProxySettings = OPI_SFTP.GetProxySettings(ProxyAddress, ProxyPort, ProxyType, ProxyLogin, ProxyPassword);
EndIf;
2025-10-05 19:19:32 +03:00
Result = OPI_SFTP.CreateConnection(SFTPSettings, ProxySettings);