A proxy server for GSPro that enables multiple launch monitors to connect simultaneously to a single GSPro instance.
GSPro's Open API typically supports only one connection at a time. This proxy allows you to:
- Connect two or more launch monitors simultaneously to one GSPro instance
- Intelligently route messages between GSPro and the appropriate launch monitor
- Switch the active launch monitor based on player information
- Create a multiplayer experience using hardware that would normally be limited to single-player
The GSPro Proxy acts as an intermediary between GSPro and multiple launch monitors:
- The proxy creates a server that emulates the GSPro Connect API
- Launch monitors connect to the proxy instead of directly to GSPro
- The proxy maintains a connection to the actual GSPro instance
- Messages from launch monitors are forwarded to GSPro
- Responses from GSPro are intelligently routed back to the appropriate launch monitor
The proxy uses player information to determine which launch monitor should be active, allowing for seamless switching between players.
Launch Monitor 1 <---> | | <---> GSPro
| GSPro Proxy |
Launch Monitor 2 <---> | |
- Connects to GSPro and multiple launch monitors
- Routes messages between GSPro and launch monitors
- Ensures only one launch monitor is active at a time based on player information
- Configurable player-to-monitor mapping
- Filters out shots from inactive launch monitors
- Clone the repository
- Install dependencies:
pip install -r requirements.txt
Start the proxy server:
python main.py [options]
--host: Host address to bind the proxy server (default: localhost)--port: Port to bind the proxy server (default: 8888)--gspro-host: GSPro host address (default: localhost)--gspro-port: GSPro WebSocket port (default: 921)--debug: Enable debug logging--config: Path to configuration file (default: config.json)
The main configuration file allows you to set default values for the proxy server:
{
"proxy": {
"host": "localhost",
"port": 8888
},
"gspro": {
"host": "localhost",
"port": 921
},
"logging": {
"debug": false
}
}The player-to-monitor mapping configuration allows you to define rules for determining which launch monitor should be active based on player information:
{
"player_monitor_rules": [
{
"player_attribute": "Handed",
"attribute_value": "RH",
"monitor_pattern": "1"
},
{
"player_attribute": "Handed",
"attribute_value": "LH",
"monitor_pattern": "2"
}
],
"allow_multiple_active_monitors": false
}Each rule consists of:
player_attribute: The attribute in the player information to check (e.g., "Handed", "Club")attribute_value: The value of the attribute to match (e.g., "RH", "LH", "DR", "PT")monitor_pattern: A pattern to match in the launch monitor name (e.g., "1", "2", "Driver", "Putter")
The proxy will check each rule in order and activate the first launch monitor that matches. If no rule matches, it will use the first available launch monitor as a fallback.
By default, the proxy ensures only one launch monitor is active at a time. However, you can enable multiple active monitors by setting allow_multiple_active_monitors to true in the configuration:
{
"player_monitor_rules": [...],
"allow_multiple_active_monitors": true
}When this option is enabled:
- Multiple launch monitors can be active simultaneously
- All active monitors can send shot data to GSPro
- Users should coordinate to avoid sending shots at the same time
- This is primarily intended for testing scenarios
Note: Enabling multiple active monitors may cause unexpected behavior in GSPro if shots are sent from different monitors in rapid succession. Use this option with caution.
The repository includes test scripts to simulate GSPro and launch monitors:
test_gspro_server.py: Simulates a GSPro server that sends player information and receives shotstest_clients.py: Simulates launch monitors that connect to the proxy and send shots
To run the tests:
-
Start the test GSPro server:
python test_gspro_server.py --debug -
Start the proxy server:
python main.py --gspro-port 8921 --debug -
Start the test clients:
python test_clients.py --port 8888 --duration 30
This creates a complete test environment with:
- A simulated GSPro server
- The GSPro proxy
- Simulated launch monitor clients
The test server implements the GSPro Connect API, allowing you to verify proxy functionality without a real GSPro installation.
If you encounter connection issues:
- Ensure GSPro is running and the Connect API is enabled
- Check that your firewall allows connections on the configured ports
- Verify that all devices are on the same network
- Check the proxy logs for detailed error information