Implement proof of concept for listing client files

This commit is contained in:
raul 2024-06-14 11:57:10 +02:00
parent 50ae8f7138
commit 67bf51af3f
1 changed files with 16 additions and 0 deletions

View File

@ -117,6 +117,22 @@ func handleConn(conn net.Conn) {
} }
go Heartbeat(ID) go Heartbeat(ID)
time.Sleep(time.Second * 1)
fmt.Println("ATTEMPT")
client, _, _ := returnClient(ID)
client.Instruct(
Instructions{
IsListFiles: true,
Path: "/home/",
},
)
message, err := ServerMessageReceiver(conn)
if err != nil {
log.Print(err)
}
for _, v := range message.FileList.File {
fmt.Println(v.Name, v.FullPath, v.IsFolder)
}
} }
func sendCommand(client Client, command string) (Output string, err error) { func sendCommand(client Client, command string) (Output string, err error) {