Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/249 host the php chess server on async.chesslablab.org #250

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
JWT_ISS=async.chesslablab.net
JWT_ISS=async.chesslablab.org
JWT_SECRET=password

UID=1000
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Asynchronous PHP chess server.
Open a console in your favorite browser and run the following commands:

```
const ws = new WebSocket('wss:https://async.chesslablab.net:8443');
const ws = new WebSocket('wss:https://async.chesslablab.org:8443');
ws.send('/start classical fen');
```

Expand Down
4 changes: 2 additions & 2 deletions cli/prod.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
$server = new Server("0.0.0.0:{$_ENV['WSS_PORT']}", $loop);

$secureServer = new SecureServer($server, $loop, [
'local_cert' => __DIR__ . '/../ssl/certificate.crt',
'local_pk' => __DIR__ . '/../ssl/private.key',
'local_cert' => __DIR__ . '/../ssl/fullchain.pem',
'local_pk' => __DIR__ . '/../ssl/privkey.pem',
'verify_peer' => false,
]);

Expand Down
4 changes: 2 additions & 2 deletions cli/staging.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
$server = new Server("0.0.0.0:{$_ENV['WSS_PORT']}", $loop);

$secureServer = new SecureServer($server, $loop, [
'local_cert' => __DIR__ . '/../ssl/certificate.crt',
'local_pk' => __DIR__ . '/../ssl/private.key',
'local_cert' => __DIR__ . '/../ssl/fullchain.pem',
'local_pk' => __DIR__ . '/../ssl/privkey.pem',
'verify_peer' => false,
]);

Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Probably the easiest way to get familiar with the chess commands is by reading t
Also a WebSocket connection with the chess server can be opened in the JavaScript console.

```js
const ws = new WebSocket('wss:https://async.chesslablab.net:8443');
const ws = new WebSocket('wss:https://async.chesslablab.org:8443');
```

That's it!
Expand Down Expand Up @@ -101,7 +101,7 @@ Let's recap.
Described below is the series of steps required to start a classical chess game with 1.e4 e5. Remember, computers and graphic user interfaces (GUIs) usually prefer the Long Algebraic Notation (LAN) format instead: e2e4 and e7e5.

```js
const ws = new WebSocket('wss:https://async.chesslablab.net:8443');
const ws = new WebSocket('wss:https://async.chesslablab.org:8443');
ws.send('/start classical fen');
ws.send('/play_lan w e2e4');
ws.send('/play_lan b e7e5');
Expand Down
6 changes: 3 additions & 3 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cp .env.example .env
Finally, you may want to add the following entry to your `/etc/hosts` file if running the PHP chess server on your localhost along with [React Chess](https://github.com/chesslablab/react-chess) as per the `REACT_APP_WS_HOST` variable defined in the [react-chess/.env.example](https://github.com/chesslablab/react-chess/blob/master/.env.example) file.

```
127.0.0.1 async.chesslablab.net
127.0.0.1 async.chesslablab.org
```

## Run the Chess Server
Expand Down Expand Up @@ -60,7 +60,7 @@ php cli/dev.php

### Staging

> Before starting the secure WebSocket server for the first time, make sure to have created the `certificate.crt` and `private.key` files into the `ssl` folder.
> Before starting the secure WebSocket server for the first time, make sure to have created the `fullchain.pem` and `privkey.pem` files into the `ssl` folder.

Run the staging secure WebSocket server if you don't want to check the website's origin.

Expand All @@ -72,7 +72,7 @@ This will allow any origin to send a request to it.

### Production

> Before starting the secure WebSocket server for the first time, make sure to have created the `certificate.crt` and `private.key` files into the `ssl` folder.
> Before starting the secure WebSocket server for the first time, make sure to have created the `fullchain.pem` and `privkey.pem` files into the `ssl` folder.

Run the secure WebSocket server to check the website's origin as defined in the `WSS_ALLOWED` variable in the `.env.example` file.

Expand Down
6 changes: 3 additions & 3 deletions docs/online-games.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ws.send('/online_games');
{
"/online_games": [
{
"iss": "async.chesslablab.net",
"iss": "async.chesslablab.org",
"iat": 1704983331,
"exp": 1704986931,
"variant": "classical",
Expand All @@ -26,7 +26,7 @@ ws.send('/online_games');
"hash": "84a4e20138e54e1869b9b79e7d3111f1"
},
{
"iss": "async.chesslablab.net",
"iss": "async.chesslablab.org",
"iat": 1704983347,
"exp": 1704986947,
"variant": "960",
Expand All @@ -39,7 +39,7 @@ ws.send('/online_games');
"hash": "c6b79ac68055766c2a33364f69c72e4c"
},
{
"iss": "async.chesslablab.net",
"iss": "async.chesslablab.org",
"iat": 1704983367,
"exp": 1704986967,
"variant": "capablanca",
Expand Down
Loading