the problem is that when windows sends a path, i have narrowed it down to the issue being that windows sends the path string as a litteral path,
so the path ~/whatever is sent as '~'/whatever which is technically a “valid” path
I want to implement into the code a check
if runtime.GOOS = windows {
// get remote $HOME variable
//replace ~ with $HOME in all strings
}
There is a runtime package and you can check if is running in Windows or not. Something like
package main
import (
"fmt"
"runtime"
)
func main() {
if runtime.GOOS == "windows" {
fmt.Println("You are running on Windows")
} else {
fmt.Println("You are running on an OS other than Windows")
}
}
It seems to me you want to create a kind of server of remote command. Say In a client machine i would send a command to that server and this executes in the remote machine. If so, an easiest way to do that is create a http server to receive comands using a url…
Tell me if I am fully understand what you want to do…
@Yamil_Bracho That would kinda go against the program, but it would be FEASABLE atleast, as sshcode already pulls a binary to exec and then sshproxy back,
@skillian the problem with that, is as far as i know on how to use that, i can only get the HomeDir of the client, not the server