Added Ip Address for request to cli removed print for speed

This commit is contained in:
Pablu23
2023-11-27 14:38:51 +01:00
parent 2374827f5a
commit d812180ce0
4 changed files with 10 additions and 7 deletions

View File

@@ -34,7 +34,7 @@ func ReceivePacket(key [32]byte, conn *net.UDPConn) common.Packet {
panic(err)
}
fmt.Printf("Decrypted Packet, Sync: %v, Type: %v\n", pck.Sync, pck.Flag)
// fmt.Printf("Decrypted Packet, Sync: %v, Type: %v\n", pck.Sync, pck.Flag)
return pck
}
@@ -63,7 +63,7 @@ func ReceivePacketWithTimeout(key [32]byte, conn *net.UDPConn) (common.Packet, b
return pck, true
}
func GetFile(path string) {
func GetFile(path string, address string) {
request := common.NewRequest(path)
k := make([]byte, 32)
@@ -74,8 +74,8 @@ func GetFile(path string) {
key := [32]byte(k)
keyExchangePck := common.NewRsaPacket(request.Sid, key)
udpAddr, err := net.ResolveUDPAddr("udp", "0.0.0.0:13374")
// udpAddr, err := net.ResolveUDPAddr("udp", "192.168.2.145:13374")
// udpAddr, err := net.ResolveUDPAddr("udp", "0.0.0.0:13374")
udpAddr, err := net.ResolveUDPAddr("udp", address)
if err != nil {
fmt.Println(err)