@@ -99,7 +99,11 @@ func (s *SshClient) startListenerForClient() error {
99
99
}
100
100
101
101
sshClient , err := ssh .Dial ("tcp" , s .config .SshUrl , sshConfig )
102
+
102
103
if err != nil {
104
+ if s .config .Debug {
105
+ s .log .Error ("failed to connect to ssh server" , "error" , err )
106
+ }
103
107
return err
104
108
}
105
109
defer sshClient .Close ()
@@ -130,21 +134,15 @@ func (s *SshClient) startListenerForClient() error {
130
134
return fmt .Errorf ("failed to listen on remote endpoint" )
131
135
}
132
136
137
+ s .config .Tunnel .RemotePort = remotePort
138
+
133
139
defer s .listener .Close ()
134
140
135
- if tunnelType == constants .Http {
136
- fmt .Printf (
137
- "🎉 Tunnel connected: %s -> 🌐 -> %s\n " ,
138
- s .config .GetHttpTunnelAddr (),
139
- s .config .Tunnel .GetLocalAddr (),
140
- )
141
- } else {
142
- fmt .Printf (
143
- "🎉 Tunnel connected: %s -> 🌐 -> %s\n " ,
144
- s .config .GetTcpTunnelAddr (remotePort ),
145
- s .config .Tunnel .GetLocalAddr (),
146
- )
147
- }
141
+ fmt .Printf (
142
+ "🎉 Tunnel connected: %s -> 🌐 -> %s\n " ,
143
+ s .config .GetTunnelAddr (),
144
+ s .config .Tunnel .GetLocalAddr (),
145
+ )
148
146
149
147
for {
150
148
// Accept incoming connections on the remote port
@@ -348,7 +346,7 @@ func (s *SshClient) Shutdown(ctx context.Context) error {
348
346
if err != nil {
349
347
return err
350
348
}
351
- s .log .Info ("stopping tunnel client server" )
349
+ s .log .Info ("stopping tunnel connection" , "address" , s . config . GetTunnelAddr () )
352
350
return nil
353
351
}
354
352
0 commit comments