Skip to content

Commit

Permalink
improve documentation for Forward service
Browse files Browse the repository at this point in the history
  • Loading branch information
jamis committed Mar 22, 2008
1 parent 39d68b3 commit 1be2180
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/net/ssh/service/forward.rb
Expand Up @@ -45,6 +45,9 @@ def initialize(session)
#
# If three arguments are given, it is as if the local bind address is
# "127.0.0.1", and the rest are applied as above.
#
# ssh.forward.local(1234, "www.capify.org", 80)
# ssh.forward.local("0.0.0.0", 1234, "www.capify.org", 80)
def local(*args)
if args.length < 3 || args.length > 4
raise ArgumentError, "expected 3 or 4 parameters, got #{args.length}"
Expand Down Expand Up @@ -75,6 +78,9 @@ def local(*args)
# Terminates an active local forwarded port. If no such forwarded port
# exists, this will raise an exception. Otherwise, the forwarded connection
# is terminated.
#
# ssh.forward.cancel_local(1234)
# ssh.forward.cancel_local(1234, "0.0.0.0")
def cancel_local(port, bind_address="127.0.0.1")
socket = @local_forwarded_ports.delete([port, bind_address])
socket.shutdown
Expand Down Expand Up @@ -116,7 +122,7 @@ def remote(port, host, remote_port, remote_host="127.0.0.1")
end
end

# an alias, for backwards compatibility with the 1.x API
# an alias, for token backwards compatibility with the 1.x API
alias :remote_to :remote

# Requests that a remote forwarded port be cancelled. The remote forwarded
Expand Down

0 comments on commit 1be2180

Please sign in to comment.