Skip to content

Commit b6c98b6

Browse files
committed
Added missing SSH_AUTH_TYPES
1 parent cd7f39d commit b6c98b6

File tree

3 files changed

+51
-2
lines changed

3 files changed

+51
-2
lines changed

.npmignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
.idea
55
.travis.yml
66
appveyor.yml
7-
jsdoc-tmpl.config.json
87
jsdoc.json
9-
wallaby.json
108
build/
119
deps/
1210
docs/

examples/ssh.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**
2+
* @author Jonathan Cardoso Machado
3+
* @license MIT
4+
* @copyright 2016, Jonathan Cardoso Machado
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10+
* of the Software, and to permit persons to whom the Software is furnished to do
11+
* so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
*/
23+
24+
/**
25+
* Example showing how one could connect to one ssh server using sftp
26+
*/
27+
var Easy = require( '../lib/Easy' ),
28+
Curl = require( '../lib/Curl' ),
29+
host = process.argv[2] || 'sftp://user:pass@host',
30+
ch, ret;
31+
32+
ch = new Easy();
33+
34+
ch.setOpt( Curl.option.URL, host );
35+
ch.setOpt( Curl.option.VERBOSE, true );
36+
ch.setOpt( Curl.option.SSH_AUTH_TYPES, Curl.ssh_auth.PASSWORD );
37+
38+
ch.onData = function( buf, size, nmemb ) {
39+
40+
console.log( buf.toString( 'utf8' ) );
41+
42+
return size * nmemb;
43+
};
44+
45+
ret = ch.perform();
46+
47+
ch.close();
48+
49+
console.log( ret, ret == Curl.code.CURLE_OK, Easy.strError( ret ) );

src/Curl.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ namespace NodeLibcurl {
266266
{ "SASL_IR", CURLOPT_SASL_IR },
267267
#endif
268268

269+
{ "SSH_AUTH_TYPES", CURLOPT_SSH_AUTH_TYPES },
270+
269271
#if NODE_LIBCURL_VER_GE( 7, 19, 4 )
270272
{ "SOCKS5_GSSAPI_NEC", CURLOPT_SOCKS5_GSSAPI_NEC },
271273
#endif

0 commit comments

Comments
 (0)