|
@@ -29,6 +29,11 @@ func HandleCreateProxySession(w http.ResponseWriter, r *http.Request) {
|
|
portString = "22"
|
|
portString = "22"
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ username, err := utils.GetPara(r, "username")
|
|
|
|
+ if err != nil {
|
|
|
|
+ username = ""
|
|
|
|
+ }
|
|
|
|
+
|
|
port, err := strconv.Atoi(portString)
|
|
port, err := strconv.Atoi(portString)
|
|
if err != nil {
|
|
if err != nil {
|
|
http.Error(w, "Invalid port number given", http.StatusInternalServerError)
|
|
http.Error(w, "Invalid port number given", http.StatusInternalServerError)
|
|
@@ -49,7 +54,7 @@ func HandleCreateProxySession(w http.ResponseWriter, r *http.Request) {
|
|
}
|
|
}
|
|
|
|
|
|
//Create an ssh process to the target address
|
|
//Create an ssh process to the target address
|
|
- err = instance.CreateNewConnection(webSshManager.GetNextPort(), ipaddr, port)
|
|
|
|
|
|
+ err = instance.CreateNewConnection(webSshManager.GetNextPort(), username, ipaddr, port)
|
|
if err != nil {
|
|
if err != nil {
|
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
|
return
|
|
return
|