The Web Player Remote Control Server (WPRC Server) is the offical WebSocket server for the Web Player Remote Control browser extension. It is a simple HTTP to WebSocket relay server that allows you to send commands via HTTP POST requests, which are then broadcasted to the connected WebSocket clients, i.e., the Web Player Remote Control browser extension.
-
Install Node.js on your machine if you haven't already.
-
Download the
web_player_remote_control_server-x.x.x.zipfolder from the latest GitHub release and extract it to a directory of your choice. -
Open a terminal in the directory where you extracted the server files and run
npm installto install the required dependencies. -
Start the server by running
node index.js. By default, the server will listen on port9772. Please refer to the Configuration section for details on how to change the port or other settings. -
Ensure the server started without errors and is running properly. You can check the server logs for any issues.
The server provides a WebSocket endpoint for the browser extension to connect to. All commands sent to the HTTP endpoint will be broadcasted to the connected WebSocket clients on this endpoint.
ws://<host>:<port>
The server provides an HTTP endpoint for sending commands to the browser extension. All commands sent to this endpoint will be broadcasted to the connected WebSocket clients on WebSocket endpoint.
The endpoint accepts POST requests with various content types, however, it is recommended to use application/json for sending commands in the JSON format.
http://<host>:<port>/command
A sample request to the HTTP endpoint looks like this:
POST http://localhost:9772/command
Content-Type: application/json
{
"type": "set-volume",
"payload": 0.8
}The server can be configured on startup using command line arguments. The following options are available:
| Option | Default | Description |
|---|---|---|
--port |
9772 |
The port on which the server will listen for incoming WebSocket connections and HTTP requests. |
--host |
localhost |
The host address on which the server will listen. |
--log |
info |
The log level for the server. Available levels are debug, info, error, and silent. |
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.