Skip to content

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.

License

Notifications You must be signed in to change notification settings

seanpfeifer/hostrelay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

go run .\cmd\server

To run a test client in TCP mode:

go run .\cmd\client
# Input strings and press enter to send. Type `exit` to quit.

For UDP:

go run .\cmd\client -udp
# Input strings and press enter to send. Type `exit` to quit.

About

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.

Topics

Resources

License

Stars

Watchers

Forks