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

Expose --debug as CLI option #446

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ You can provide config object to `PeerServer` function or specify options for `p
| `--sslkey` | `sslkey` | Path to SSL key (string) | No | |
| `--sslcert` | `sslcert` | Path to SSL certificate (string) | No | |
| `--allow_discovery` | `allow_discovery` | Allow to use GET `/peers` http API method to get an array of ids of all connected clients (boolean) | No | |
| `--debug` | `debug` | Enable debug (boolean) | No | |
| `--cors` | `corsOptions` | The CORS origins that can access this server |
| | `generateClientId` | A function which generate random client IDs when calling `/id` API method (`() => string`) | No | `uuid/v4` |

Expand Down
6 changes: 6 additions & 0 deletions bin/peerjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ const opts = y
demandOption: false,
describe: "allow discovery of peers",
},
debug: {
type: "boolean",
demandOption: false,
describe: "enable debug",
},
proxied: {
type: "boolean",
demandOption: false,
Expand All @@ -86,6 +91,7 @@ const opts = y
},
})
.boolean("allow_discovery")
.boolean("debug")
.parseSync();

if (!opts.port) {
Expand Down