Skip to content

WebMCDevelopment/EaglerRelayJS

Repository files navigation

EaglerRelayJS

Eaglercraft relay server implementation written in TypeScript

Note

Most of the code was ported directly from the original java implementation, so there will probably be some bugs I missed.

Features:

  • Base relay server
  • IP forwarding
  • Origin whitelist
  • Join code customization
  • STUN / TURN server support
  • Rate limiting

Usage:

Standalone

$ npm install -g eaglerrelayjs
$ mkdir -p relay
$ cd relay
$ eaglerrelayjs --port 8080

Existing App

import http from 'http';
import express from 'express';
import { EaglerSPRelay } from 'eaglerrelayjs';

const app = express();
const server = http.createServer(app);
const relay = new EaglerSPRelay({ debug: true });

app.use((_req, res) => {
  res.set('Content-Type', 'text/plain');
  res.status(426).end('Upgrade Required');
});

server.on('upgrade', (req, socket, head) => relay.handleUpgrade(req, socket, head));
server.listen(8080);

Contributing:

Contributions are welcome, but please keep the code style consistent.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published