diff --git a/README.md b/README.md index 8565d3b6..b8386eca 100644 --- a/README.md +++ b/README.md @@ -941,6 +941,8 @@ You can find more examples in the `examples` directory of this repository. * **forwardOut**(< _string_ >boundAddr, < _integer_ >boundPort, < _string_ >remoteAddr, < _integer_ >remotePort, < _function_ >callback) - _boolean_ - Alert the client of an incoming TCP connection on `boundAddr` on port `boundPort` from `remoteAddr` on port `remotePort`. `callback` has 2 parameters: < _Error_ >err, < _Channel_ >stream. Returns `false` if you should wait for the `continue` event before sending any more traffic. +* **openssh_authAgent**(< _function_ >callback) - _boolean_ - Alert the client of an incoming `ssh-agent` socket connection. `callback` has 2 parameters: < _Error_ >err, < _Channel_ >stream. Returns `false` if you should wait for the `continue` event before sending any more traffic. + * **openssh_forwardOutStreamLocal**(< _string_ >socketPath, < _function_ >callback) - _boolean_ - Alert the client of an incoming UNIX domain socket connection on `socketPath`. `callback` has 2 parameters: < _Error_ >err, < _Channel_ >stream. Returns `false` if you should wait for the `continue` event before sending any more traffic. * **rekey**([< _function_ >callback]) - _boolean_ - Initiates a rekeying with the client. If `callback` is supplied, it is added as a one-time handler for the `rekey` event. Returns `false` if you should wait for the `continue` event before sending any more traffic. diff --git a/lib/server.js b/lib/server.js index 424ad272..fdadbf2f 100644 --- a/lib/server.js +++ b/lib/server.js @@ -648,6 +648,10 @@ Client.prototype.forwardOut = function(boundAddr, boundPort, remoteAddr, return openChannel(this, 'forwarded-tcpip', opts, cb); }; +Client.prototype.openssh_authAgent = function(cb) { + return openChannel(this, 'auth-agent@openssh.com', cb); +}; + Client.prototype.openssh_forwardOutStreamLocal = function(socketPath, cb) { var opts = { socketPath: socketPath @@ -1123,6 +1127,8 @@ function openChannel(self, type, opts, cb) { ret = sshstream.forwardedTcpip(localChan, initWindow, maxPacket, opts); else if (type === 'x11') ret = sshstream.x11(localChan, initWindow, maxPacket, opts); + else if(type === 'auth-agent@openssh.com') + ret = sshstream.openssh_authAgent(localChan, initWindow, maxPacket); else if (type === 'forwarded-streamlocal@openssh.com') { ret = sshstream.openssh_forwardedStreamLocal(localChan, initWindow,