hostrelay

package module
v0.0.0-...-c6f75b2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2020 License: MIT Imports: 0 Imported by: 0

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

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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
client command
server command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL