Skip to content

BentLent/comstar

Repository files navigation

Comstar: P2P UDP Tunnel for xemu

Comstar is a simple, peer-to-peer UDP relay server designed to connect instances of xemu (the original Xbox emulator) across the internet. By utilizing the Hyperswarm DHT network, Comstar creates decentralized "lobbies" that allow players to connect without the need for complex router configurations, port forwarding, or dedicated VPNs.

It listens for local UDP packets generated by xemu, encapsulates them, and broadcasts them over a P2P swarm to all other peers in your lobby. When remote packets are received, they are forwarded back to your local xemu instance.

Features

  • Zero-Config Networking: Uses Hyperswarm for NAT traversal and peer discovery. No port forwarding required.
  • Room Codes: Easily play with friends using generated, shareable room codes.
  • [WIP] MAC Learning & Switching: Optionally behaves like a network switch, learning MAC addresses from packet headers to route traffic efficiently (rather than blindly flooding the network).
  • Cross-Platform: Runs anywhere Node.js runs.

Prerequisites

  • Node.js (v16 or higher recommended)
  • xemu emulator

Installation

  1. Clone or download this repository.
  2. Install the required dependencies:
npm install

Alternatively, @yao/pkg packaged binaries will be provided in the Releases tab.

Usage

Comstar operates via a command-line interface. One player must host a lobby, and the other player(s) will join using the generated code.

Hosting a Lobby

To create a new lobby, use the host command:

node comstar.js host

The console will clear and display your unique Room Code. Share this code with your friends.

You can also specify a custom topic to generate a static, reproducible room code:

node comstar.js host "my-secret-halo-lobby"

Joining a Lobby

To join an existing lobby, use the join command followed by the room code provided by the host:

node comstar.js join <Room_Code>

Global Options

You can append these options to either the host or join commands to customize the network binding and logging:

  • -p, --port <port>: The local UDP port Comstar listens on. (Default: 1337)
  • --host <host>: The local interface to bind to. (Default: 127.0.0.1)
  • -v, --verbose: Enables verbose debug output for troubleshooting packet routing.

Example:

node comstar.js join ABCDEFG -p 2000 -v

Configuring xemu

Once Comstar is running (either hosting or joined), you need to tell your xemu emulator to send its network traffic to Comstar.

  1. Open xemu.
  2. Go to Machine -> Settings -> Network.
  3. Under the Attached to dropdown, select UDP Tunnel.
  4. Configure the ports:
    • Bind Address: Set this to any free port on 0.0.0.0 (e.g., 0.0.0.0:1338).
    • Remote Address: Set this to whichever port Comstar is running on 127.0.0.1 (e.g., 127.0.0.1:1337)

How it works: xemu will send outbound Xbox network traffic to 127.0.0.1:1337. Comstar captures this, routes it through the Hyperswarm DHT to your friends, and sends their inbound traffic back to your xemu client at 1338.

License

This software is released under the GNU General Public License v2.0 (or later). See the source headers for details. Copyright (C) 2026 Trenton "Raz" Robichaux.

About

a simple, peer-to-peer UDP relay server designed to connect instances of xemu (https://xemu.app/) (the original Xbox emulator) across the internet by utilizing the Hyperswarm (https://github.com/holepunchto/hyperswarm) DHT network.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors