https://github.com/beka-birhanu/udp-socket-manager
udp client server socket manager with proto buffer encoding and DTLS security
https://github.com/beka-birhanu/udp-socket-manager
dtls golang protobuf socket-programming udp udp-socket
Last synced: 4 months ago
JSON representation
udp client server socket manager with proto buffer encoding and DTLS security
- Host: GitHub
- URL: https://github.com/beka-birhanu/udp-socket-manager
- Owner: beka-birhanu
- Created: 2025-02-06T17:17:33.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-03-01T23:46:00.000Z (4 months ago)
- Last Synced: 2026-03-02T02:11:50.335Z (4 months ago)
- Topics: dtls, golang, protobuf, socket-programming, udp, udp-socket
- Language: Go
- Homepage:
- Size: 27.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# **UDP Socket Manager**
## **Overview**
UDP-based Socket Manager for secure communication using asymmetric and symmetric encryption is a wrapper over UDP. It uses Protocol Buffers for message encoding and supports DTLS for secure communication.
## **How It Works**
1. **Client Fetches Server Public Key** – The client retrieves the server’s public key.
2. **Client Hello** – The client sends a `hello` message containing a random value and an AES-CBC key, encrypted with the server’s public key.
3. **Server Hello Verify** – The server responds with a `helloverify` message containing a cookie HMAC, using the AES-CBC key from the client.
4. **Client Verification** – The client resends the `hello` message with the cookie HMAC, AES-CBC key, and a verification token.
5. **Server Hello** – The server completes the handshake by sending a session ID.
6. **Session Maintenance** – The client continues communication while maintaining heartbeat messages; otherwise, the session expires.
## **Message Structure**
| Field | Description |
|---------------|-------------------------|
| Message Type | 1 byte |
| Payload | ... rest of the message |
### **Message Types**
```plaintext
ClientHelloRecordType = 1
HelloVerifyRecordType = 2
ServerHelloRecordType = 3
PingRecordType = 4
PongRecordType = 5
UnAuthenticated = 6
```
Any value greater than these can be used as a custom message type.
## Docs
[Socket Client docs](./docs/socket-client.md)
[Socket Server docs](./docs/socket-server.md)