https://github.com/seanpfeifer/hostrelay
A dedicated relay server for P2P networking without exposing client IP addresses. ***You should probably use "Steam Datagram Relay" if you need a production-ready system for something similar.
https://github.com/seanpfeifer/hostrelay
go networking unity unity3d
Last synced: about 1 month ago
JSON representation
A dedicated relay server for P2P networking without exposing client IP addresses. ***You should probably use "Steam Datagram Relay" if you need a production-ready system for something similar.
- Host: GitHub
- URL: https://github.com/seanpfeifer/hostrelay
- Owner: seanpfeifer
- License: mit
- Created: 2020-05-25T02:23:01.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2020-12-02T07:35:57.000Z (over 5 years ago)
- Last Synced: 2025-10-04T06:29:56.829Z (9 months ago)
- Topics: go, networking, unity, unity3d
- Language: Go
- Homepage:
- Size: 19.5 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Host Relay Prototype
The point of this is to be a dedicated relay server for multiplayer applications with two needs:
* Reliable, ordered data transmission (TCP-like)
* Unreliable data transmission (UDP)
This exists to allow players to join games that don't need dedicated server logic.
**DISCLAIMER: This is a hacked together prototype and should not be used in production! Code will change without warning and nothing is guaranteed!**
## What this **doesn't have**
* Anti-cheat
* Data sanity checking
* Anti-spam/congestion control
* Complex authentication
## Basic design
* TCP socket listening for connections
* Each connection is stored
* UDP socket to listen for messages from each player
* Broadcast each received message to the rest of the connected players
## Building & running
```sh
go run .\cmd\server
```
To run a test client in TCP mode:
```sh
go run .\cmd\client
# Input strings and press enter to send. Type `exit` to quit.
```
For UDP:
```sh
go run .\cmd\client -udp
# Input strings and press enter to send. Type `exit` to quit.
```