File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1066,6 +1066,8 @@ You can find more examples in the `examples` directory of this repository.
10661066
10671067 * ** highWaterMark** - _ integer_ - This is the ` highWaterMark ` to use for the parser stream. ** Default:** ` 32 * 1024 `
10681068
1069+ * ** server** - _ object_ - This option allow you to explicitly define the tcp server ` ssh2 ` is going to use. ** Default:** ` new net.Server() `
1070+
10691071 * ** debug** - _ function_ - Set this to a function that receives a single string argument to get detailed (local) debug information. ** Default:** (none)
10701072
10711073#### Connection events
Original file line number Diff line number Diff line change @@ -318,7 +318,10 @@ class Server extends EventEmitter {
318318 const ident = ( cfg . ident ? Buffer . from ( cfg . ident ) : undefined ) ;
319319 const offer = new KexInit ( algorithms ) ;
320320
321- this . _srv = new netServer ( ( socket ) => {
321+ this . _srv = cfg . server || new netServer ( ) ;
322+
323+ this . _srv . on ( 'connection' , ( socket ) => {
324+
322325 if ( this . _connections >= this . maxConnections ) {
323326 socket . destroy ( ) ;
324327 return ;
You can’t perform that action at this time.
0 commit comments