
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
This project provides a secure, reliable UDP socket implementation with multi-peer hole punching capabilities for peer-to-peer communication.
pip install -r requirements.txt
The MultiHolepunchSocket
class provides a way to establish multiple peer-to-peer connections using UDP hole punching:
from srmudp_chat import MultiHolepunchSocket
# Create a socket on a specific port
socket = MultiHolepunchSocket(port=8000)
# Add peers
socket.add_peers({
"peer1": "192.168.1.100:8001",
"peer2": "example.com:8002"
})
# Send a message to all connected peers
socket.send(b"Hello, everyone!")
# Send a message to a specific peer
socket.send(b"Hello, peer1", recipient="peer1")
# Send a message to multiple peers
socket.send(b"Hello, selected peers", recipient=["peer1", "peer2"])
# Receive a message
msg = socket.receive(timeout=1.0)
if msg:
print(f"Received: {msg.content} from {msg.peer}")
# Remove a peer
socket.remove_peer("peer1")
# Close the socket
socket.close()
The project includes a simple chat application that demonstrates the use of the MultiHolepunchSocket
:
python chat_app.py -p 8000 -n YourNickname
Options:
-p, --port PORT
: Local port to bind to (0 for random)-n, --nick NICK
: Your nickname in the chat-c, --config FILE
: Path to a config file with peers-v, --verbose
: Enable verbose logging/help
: Show help message/list
: List all connected peers/add <nick> <addr>
: Add a new peer/remove <nick>
: Remove a peer/msg <nick> <message>
: Send a private message to a peer/save <file>
: Save current peers to a config file/load <file>
: Load peers from a config file/quit
: Exit the applicationpython chat_app.py -p 8000 -n Alice
Note the IP address and port (check the log messages or use /list
).
python chat_app.py -p 8001 -n Bob
In Bob's chat window:
/add Alice 192.168.1.100:8000
In both chat windows:
/list
In Alice's window (broadcasts to all connected peers):
Hello, everyone!
Or send a private message to Bob:
/msg Bob Hello, Bob!
/save my_peers.json
Later, you can load this configuration:
/load my_peers.json
The implementation uses UDP hole punching to establish peer-to-peer connections through NATs. Each peer establishes and maintains connections with multiple other peers using a single UDP socket.
Messages are encrypted using AES-GCM for security and include sequence numbers and acknowledgments for reliability. The implementation handles packet reordering, retransmission, and connection management.
Run the tests:
python -m unittest test_multi_holepunch.py
python -m unittest test_multi_holepunch_protocol.py
MIT
FAQs
Unknown package
We found that srmudp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.