Я хочу знать, как выполнить push для удаленного доступа с помощью параметров прокси с помощью nodegit.
Я прочитал много вопросов, связанных с push, но ни один из них не охватывает, как использовать push-настройки с помощью прокси. Любая помощь будет оценена.
var proxyOptions = new nodegit.ProxyOptions();
proxyOptions.url="http://http.proxy.abc.com:8000";
proxyOptions.type=2;
proxyOptions.version=1;
var pushOpts = new nodegit.PushOptions();
pushOpts.proxyOpts=proxyOptions;
.then(function(remote) {
return remote.push(["refs/heads/"+remoteBranchName+":refs/heads/"+remoteBranchName],{
callbacks: {
credentials: function(url, userName) {
console.log("Requesting creds");
return nodegit.Cred.userpassPlaintextNew("XXX@gmail.com", "XXX");s
},
}
},pushOpts );
}).catch(function (err) {
console.log(err);
});
{ [Error: failed to send request: The operation timed out
] errno: -1, errorFunction: 'Remote.push' }
Это сообщение об ошибке, которое я получаю. Это означает, что запрос не был выполнен из-за проблем с прокси.
У меня были похожие проблемы с клоном. Но удалось решить с помощью cloneopts.
cloneOptions.fetchOpts ={
proxyOpts:proxyOptions,
};
nodegit.Clone( url,path1,cloneOptions)