Skip to content
Permalink
Browse files

Change up how messages are sent

  • Loading branch information...
antoniomika committed May 30, 2019
1 parent 63dfcb7 commit ea56e19f54bc0840247a72773ba389bda015df7c
Showing with 6 additions and 4 deletions.
  1. +6 −4 requests.go
@@ -82,7 +82,7 @@ func handleRemoteForward(newRequest *ssh.Request, sshConn *SSHConnection, state
connType = "https"
}

sshConn.Messages <- fmt.Sprintf("\nStarting SSH Fowarding service for %s:%s. Forwarded connections can be accessed via the following methods:", connType, stringPort)
requestMessages := fmt.Sprintf("\nStarting SSH Fowarding service for %s:%s. Forwarded connections can be accessed via the following methods:\r\n", connType, stringPort)

if stringPort == "80" || stringPort == "443" {
scheme := "http"
@@ -101,15 +101,17 @@ func handleRemoteForward(newRequest *ssh.Request, sshConn *SSHConnection, state
state.HTTPListeners.Store(host, pH)
defer state.HTTPListeners.Delete(host)

sshConn.Messages <- fmt.Sprintf("HTTP: http://%s:%d", host, *httpPort)
requestMessages += fmt.Sprintf("HTTP: http://%s:%d\r\n", host, *httpPort)

if *httpsEnabled {
sshConn.Messages <- fmt.Sprintf("HTTPS: https://%s:%d", host, *httpsPort)
requestMessages += fmt.Sprintf("HTTPS: https://%s:%d", host, *httpsPort)
}
} else {
sshConn.Messages <- fmt.Sprintf("TCP: %s:%d", *rootDomain, chanListener.Addr().(*net.TCPAddr).Port)
requestMessages += fmt.Sprintf("TCP: %s:%d", *rootDomain, chanListener.Addr().(*net.TCPAddr).Port)
}

sshConn.Messages <- requestMessages

go func() {
for {
select {

0 comments on commit ea56e19

Please sign in to comment.
You can’t perform that action at this time.