I’m trying to have a simple UDP echo client/server communicate with each other. The client program (which runs in the host Windows) sends packets to the server (which runs in WSL-2), and the server receives them, but the server’s reply is never reaches the client. The output on Windows: The output on Linux: And now I’m stumped. TCP connections work
Tag: network-programming
I can’t find the error in my socket python program
I was following a socket tutorial and suddenly there was a bug in my code that I couldn’t understand or find Can anyone help me find the bug? I referenced with the tutorial code and it doesn’t work. The only way is to copy/paste and I don’t like it this is my server.py file And this is my client.py file
Unable to get the network’s broadcast address with Python’s Ipaddress module
This is my code to get the broadcast address of my network: It first gets the local IP and then the subnet mask. I know I can do a binary calculation to obtain the broadcast address, but I am wondering why the above function does not work. This outputs IPv4Address(‘192.168.1.47’). I expect it to output 192.168.1.255. Why does this happen?
extracting public key from certificate and encrypting data
This is for a homework assignment! I get the server’s certificate using get_peer_certificate() and the calling dump_certificate to dump the certificate in a variable. The format is PEM and looks right to me. How do I extract the server’s public key from this file (‘server.pubkey’) and encrypt plaintext using RSA algorithm and any python library. At the time of writing
How do you determine if an IP address is private, in Python?
In Python, what is the best way to determine if an IP address (e.g., ‘127.0.0.1’ or ‘10.98.76.6’) is on a private network? The code does not sound difficult to write. But there may be more edge cases than are immediately apparent, and there’s IPv6 support to consider, etc. Is there an existing library that does it? Answer Check out the