]>
Commit | Line | Data |
---|---|---|
1 | <?php | |
2 | ||
3 | if (!defined('UNREALIRCD_RPC_USER') || | |
4 | !defined('UNREALIRCD_RPC_PASSWORD') || | |
5 | !defined('UNREALIRCD_HOST') || | |
6 | !defined('UNREALIRCD_PORT') | |
7 | ) die("Unable to find RPC credentials in your config.php"); | |
8 | ||
9 | $tls_verify = (defined('UNREALIRCD_SSL_VERIFY')) ? UNREALIRCD_SSL_VERIFY : true; | |
10 | $api_login = UNREALIRCD_RPC_USER.":".UNREALIRCD_RPC_PASSWORD; | |
11 | ||
12 | /* Connect now */ | |
13 | try { | |
14 | $rpc = new UnrealIRCd\Connection("wss://".UNREALIRCD_HOST.":".UNREALIRCD_PORT, | |
15 | $api_login, | |
16 | Array("tls_verify"=>$tls_verify)); | |
17 | } catch (Exception $e) { | |
18 | die("Unable to connect to UnreaIRCd<br>"); | |
19 | } |