After starting the Pac-Man game in a browser by clicking the button below, use a telnet client and telnet to: (port number 2000) or telnet to 'localhost' if the telnet client and server execute on the same machine.

Start the Pac-Man Game

The game controller, which includes the telnet server, is designed entirely in the Lua scripting language. The game controller is responsible for proxying the traffic between the telnet client and the Pac-Man game running in the browser. The game controller's source code (Lua script) uses ready to use components such as the high level socket/websocket API.

How the Telnet to Pac-Man Server Works

  1. A browser navigates to the Pac-Man "game controller" running in the server.
  2. The Pac-Man game, which is completely implemented in JavaScript, is loaded into the browser.
  3. The browser loads all resources such as the MP3 sound files.
  4. The game's JavaScript code opens a persistent websocket communication channel with the server.
  5. The game is now ready to accept a telnet connection.
  6. A telnet client connects to the server.
  7. The game controller connects the two clients together and initiates the game.
  8. Keyboard events are sent from the telnet client to the Pac-Man game running in the browser via the game controller proxy.
  9. When the game ends, JavaScript code sends an event to the game controller, which then terminates the telnet connection.

Start the Pac-Man Game

After starting the Pac-Man game in a browser, use a telnet client and telnet to: port# 2000