From b1cb51d887a4bd7cce129c05c5cec2de628c71fd Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 7 Apr 2015 13:11:27 -0400 Subject: [PATCH] Added ssh Connection to callback so additional info is available about connection --- server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.go b/server.go index 4cf0e5c..0da7a75 100644 --- a/server.go +++ b/server.go @@ -16,7 +16,7 @@ const DefaultRPCChannel = "RPCChannel" const RPCSubsystem = "RPCSubsystem" // CallbackFunc to be called when reverse RPC client is created -type CallbackFunc func(RPCClient *rpc.Client) +type CallbackFunc func(RPCClient *rpc.Client, conn ssh.Conn) // Server represents an SSH Server that spins up RPC servers when requested. type Server struct { @@ -122,7 +122,7 @@ func (s *Server) handleChannels(chans <-chan ssh.NewChannel, sshConn ssh.Conn) { } rpcClient := rpc.NewClient(clientChannel) if s.CallbackFunc != nil { - s.CallbackFunc(rpcClient) + s.CallbackFunc(rpcClient, sshConn) } log.Printf("Started SSH RPC client") default: