Skip to content

Commit

Permalink
fix(http): return URLs without port
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuri committed May 30, 2021
1 parent 26d3131 commit 334ca99
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions server/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,8 @@ func (s *SSHServer) handleChannels(client *client, chans <-chan ssh.NewChannel)
}
client.ch = chconn

_, port, _ := net.SplitHostPort(s.opts.HTTPAddr)
if port == "80" {
port = ""
} else {
port = fmt.Sprintf(":%s", port)
}

client.write(fmt.Sprintf("Generated HTTP URL: http://%s.%s%s\n", client.id, s.domain, port))
client.write(fmt.Sprintf("Generated HTTPS URL: https://%s.%s%s\n", client.id, s.domain, port))
client.write(fmt.Sprintf("Generated HTTP URL: http://%s.%s\n", client.id, s.domain))
client.write(fmt.Sprintf("Generated HTTPS URL: https://%s.%s\n", client.id, s.domain))
}
}

Expand Down

0 comments on commit 334ca99

Please sign in to comment.