This project sets up a WebSocket server that enables remote joystick connections using the ViGEmBus protocol. The server processes joystick data received from clients and formats it for use with the ViGEmBus virtual controller interface.
- Remote Joystick Support: Clients send joystick data over WebSocket connections.
- Data Processing: The server interprets the joystick state (axes and buttons) and forwards this information to virtual controllers via the ViGEmBus protocol.
- Virtual Controller Management: Supports creating and disconnecting virtual controllers as needed.
- Node.js: Install Node.js via nodejs.org
- Python 3.11: This project requires Python 3.11 for certain dependencies. Make sure it is installed and accessible on your system.
- ViGEmBus Driver: Ensure the ViGEmBus driver is installed on your Windows machine.
-
Clone the repository:
git clone https://github.com/yourusername/my-websocket-server.git
-
Navigate to the project directory:
cd my-websocket-server -
Install the Node.js dependencies:
npm install
To start the WebSocket server, run the following command:
node src/server.jsor
npm startThe server will listen for incoming WebSocket connections. When a connection is established, it will process joystick data sent by clients.
Clients should send joystick data in JSON format as shown below:
{
"type": "joystick",
"index": 0,
"axes": [0.9837390184402466, -0.16395652294158936, 0, 0],
"buttons": [1, 0, 1, 1, 1, 1, 0.9970674514770508, 0.9970674514770508, 0, 0, 0, 0, 0, 0, 0, 0, 0]
}The server will interpret this data and forward it to the ViGEmBus interface to update the state of the corresponding virtual controller.
This project is licensed under the MIT License. See the LICENSE file for details.
Made by Jona 😊