- Run server.js with Node.js
- Open http://localhost:8080/worker.html in your browser (Browser must support Adobe Flash and WebSockets)
- Send API requests
Send a HTTP request on port 80 to the API server where the ping is the path of the URI. The parts of the ping have to be separated by "-" (minus) instead of " " (space). Example: http://server/12-34-56-78-90-12-34-56-78-90-12-34-56-78-90-12-34-56-78-90 (Do not use a trailing slash!)
The response will be a JSON encoded object. The object will always have an "status" property. (Status codes in next section) If the status is 100 (OK) there will also be a "ping" and "pong" property. "ping" will be the initial sent ping, "pong" will be the generated pong. The "ping" and "pong" properties will be "-" (minus) separated and so have to get decoded. If the status code is not 100 the "ping" and "pong" properties will be missing.
- 100 - OK
- 201 - Ping scheme not valid
- 202 - Unknown error generating the pong, maybe Adobe Flash crashed while generating the ping.
- 203 - There are currently no running worker processes, try again in a minute
- 290 - The ping you sent is currently getting processed. - This error should be really rare and is an issue in the servers design and how it handles the callbacks. This will get fixed some time.
- 291 - There was an error while sending the ping to the worker, maybe the connection closed just in this moment. Just retry and send the ping again. - This will get fixed in the future so the server automatically sends the ping command to another worker.