Say I want to run multiple mcpe servers on 1 physical server with 1 public ip on the same port, how would I do that? With websites I would use something like nginx to route them based on domain name, is there a way to route mcpe servers by domain name using special software or would nginx work, because nginx handles websockets.
You could have one "relay" server that uses the loginpacket to check what domain the player entered and then transfer the player to the server he/she wants, that runs on another port.
Something along those lines should work PHP: protected $players = [];protected $servers = [ "mycool.server.com" => ["mynormal.server.com", 19132], "mycooler.server.com" => ["mynormal.server.com", 19133], "mycoolest.server.com" => ["mynormal.server.com", 19134]];public function onLoginPacket(DataPacketReceiveEvent $event){ $packet = $event->getPacket(); if($packet instanceof LoginPacket){ $this->players[TextFormat::clean($packet->username)] = $packet->serverAddress; }}public function onPreLogin(PlayerPreLoginEvent $event) { $name = $event->getPlayer()->getName(); if (isset($this->players[$name]) && isset($this->servers[$this->players[$name]])) { $server = $this->servers[$this->players[$name]]; $event->getPlayer()->transfer($server[0], $server[1]); } else { $event->getPlayer()->kick(); }} Though, I'm not sure if transfering players on PreLoginEvent will work.