-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.js
executable file
·72 lines (64 loc) · 1.57 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env node
/* eslint-env node */
import meow from "meow";
const cli = meow(
`
Usage
$ xmpp-console [service]
Options
--port, -p 8080 port for the web interface
--web, -w use web interface
--no-open, prevents opening the url for the web interface
--type, -t client (default) or component
--username, -u the username for authentication
--password, -p the password for authentication
--domain, -d the service domain
Examples
$ xmpp-console localhost (auto)
$ xmpp-console xmpp://localhost[:5222] (classic XMPP)
$ xmpp-console xmpps://localhost[:5223] (direct TLS)
$ xmpp-console ws://localhost:5280/xmpp-websocket (WebSocket)
$ xmpp-console wss://localhost:5443/xmpp-websocket (Secure WebSocket)
$ xmpp-console xmpp://component.localhost[:5347] --type component (component)
`,
{
flags: {
port: {
type: "number",
default: 8080,
},
web: {
type: "boolean",
default: false,
},
open: {
type: "boolean",
default: true,
},
type: {
type: "string",
default: "client",
},
username: {
type: "string",
},
password: {
type: "string",
},
domain: {
type: "string",
},
},
}
);
process.title = "@xmpp/console";
const [service] = cli.input;
(async () => {
const impl = await import(
new URL(cli.flags.web ? "./src/server.js" : "./src/cli.js", import.meta.url)
);
impl.default({
...cli.flags,
service,
});
})();